Skip to content

Instantly share code, notes, and snippets.

@ConradIrwin
Created April 24, 2024 20:01
Show Gist options
  • Save ConradIrwin/c33390afd62c8643869070bcfb86b107 to your computer and use it in GitHub Desktop.
Save ConradIrwin/c33390afd62c8643869070bcfb86b107 to your computer and use it in GitHub Desktop.

Remote Development in Zed

At Zed we believe that great things are built by great people working together. We have designed Zed to help every individual work faster and to help teams of people work together more effectively.

Remote development allows you to launch a headless version of Zed on a development server, so that you and your team can edit projects without cloning them locally.

NOTE remote development is at very early stage of preview release with a number of limitations. Notably, you cannot currently use Zed’s terminal remotely, setup is very manual still, and we do not have the ability to install extensions on the headless instances of zed. If you’d like to try it out please reach out to [email protected] and ask to be added to the feature flag.

Getting started with remote development

  • Make sure Zed is v0.133.0 or later (cmd-shift-p About)
  • Open the “remote projects” dialog (cmd-shift-p projects: Open Remote)
  • Click “Create new server”, and give it a name
  • Log into that server, and run zed with the given token.
    • (Note this will require you having installed zed there, which is currently a bit of a pain).
  • On your laptop you should see a “Congratulations!” once your server connects to zed.dev
  • Now you can create a new project on that server by clicking the “+” button.
  • And you can open it by clicking on it.

Running your own collab server

NOTE This is not recommended, but may be necessary if your corporate policies prevent outbound HTTP from development servers.

  • Clone the repo:

    • git clone [email protected]:zed-industries/zed
    • cd zed
    • git submodule update --init --recursive
  • Install Postgres

  • Edit crates/collab/seed.default.json to contain the users you’d like to use

  • Run ./script/bootstrap

  • Run cargo install to install the zed binary on the dev server

  • Run RUST_LOG=info cargo run -p collab serve

  • Once you have that running, you can use SSH to expose port 8080 of your dev-server to port 8080 locally:

    • ssh -L 8080:localhost:8080 <dev-server>
  • Now on both laptop and dev-server curl http://localhost should return collab v0.44.0 XXX

  • Update your local zed to use the local server:

    • export ZED_ADMIN_API_TOKEN=secret (or to match what’s configured in .env.toml on the server)
    • export ZED_IMPERSONATE=<your-github-name> (to match what’s configured in seed.default.json)
    • export ZED_RPC_URL=http://localhost:8080/rpc
    • Run zed
  • When given the instructions to run zed —dev-server-token, first export ZED_RPC_URL=http://localhost:8080/rpc .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment