Update instructions for local collaboration (#35689)

Release Notes:

- N/A
This commit is contained in:
Mikayla Maki 2025-08-06 11:10:28 -07:00 committed by GitHub
parent b08e26df60
commit 794098e5c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 39 additions and 11 deletions

View file

@ -1,13 +1,27 @@
# Local Collaboration
First, make sure you've installed Zed's dependencies for your platform:
1. Ensure you have access to our cloud infrastructure. If you don't have access, you can't collaborate locally at this time.
- [macOS](./macos.md#backend-dependencies)
- [Linux](./linux.md#backend-dependencies)
- [Windows](./windows.md#backend-dependencies)
2. Make sure you've installed Zed's dependencies for your platform:
- [macOS](#macos)
- [Linux](#linux)
- [Windows](#backend-windows)
Note that `collab` can be compiled only with MSVC toolchain on Windows
3. Clone down our cloud repository and follow the instructions in the cloud README
4. Setup the local database for your platform:
- [macOS & Linux](#database-unix)
- [Windows](#database-windows)
5. Run collab:
- [macOS & Linux](#run-collab-unix)
- [Windows](#run-collab-windows)
## Backend Dependencies
If you are developing collaborative features of Zed, you'll need to install the dependencies of zed's `collab` server:
@ -18,7 +32,7 @@ If you are developing collaborative features of Zed, you'll need to install the
You can install these dependencies natively or run them under Docker.
### MacOS
### macOS
1. Install [Postgres.app](https://postgresapp.com) or [postgresql via homebrew](https://formulae.brew.sh/formula/postgresql@15):
@ -76,7 +90,7 @@ docker compose up -d
Before you can run the `collab` server locally, you'll need to set up a `zed` Postgres database.
### On macOS and Linux
### On macOS and Linux {#database-unix}
```sh
script/bootstrap
@ -99,7 +113,7 @@ To use a different set of admin users, you can create your own version of that j
}
```
### On Windows
### On Windows {#database-windows}
```powershell
.\script\bootstrap.ps1
@ -107,7 +121,7 @@ To use a different set of admin users, you can create your own version of that j
## Testing collaborative features locally
### On macOS and Linux
### On macOS and Linux {#run-collab-unix}
Ensure that Postgres is configured and running, then run Zed's collaboration server and the `livekit` dev server:
@ -117,12 +131,16 @@ foreman start
docker compose up
```
Alternatively, if you're not testing voice and screenshare, you can just run `collab`, and not the `livekit` dev server:
Alternatively, if you're not testing voice and screenshare, you can just run `collab` and `cloud`, and not the `livekit` dev server:
```sh
cargo run -p collab -- serve all
```
```sh
cd ../cloud; cargo make dev
```
In a new terminal, run two or more instances of Zed.
```sh
@ -131,7 +149,7 @@ script/zed-local -3
This script starts one to four instances of Zed, depending on the `-2`, `-3` or `-4` flags. Each instance will be connected to the local `collab` server, signed in as a different user from `.admins.json` or `.admins.default.json`.
### On Windows
### On Windows {#run-collab-windows}
Since `foreman` is not available on Windows, you can run the following commands in separate terminals:
@ -151,6 +169,12 @@ Otherwise,
.\path\to\livekit-serve.exe --dev
```
You'll also need to start the cloud server:
```powershell
cd ..\cloud; cargo make dev
```
In a new terminal, run two or more instances of Zed.
```powershell
@ -161,7 +185,10 @@ Note that this requires `node.exe` to be in your `PATH`.
## Running a local collab server
If you want to run your own version of the zed collaboration service, you can, but note that this is still under development, and there is no good support for authentication nor extensions.
> [!NOTE]
> Because of recent changes to our authentication system, Zed will not be able to authenticate itself with, and therefore use, a local collab server.
If you want to run your own version of the zed collaboration service, you can, but note that this is still under development, and there is no support for authentication nor extensions.
Configuration is done through environment variables. By default it will read the configuration from [`.env.toml`](https://github.com/zed-industries/zed/blob/main/crates/collab/.env.toml) and you should use that as a guide for setting this up.