1. Click "Connect New Server" and enter the command you use to SSH into the server. See [Supported SSH options](#supported-ssh-options) for options you can pass.
1. Your local machine will attempt to connect to the remote server using the `ssh` binary on your path. Assuming the connection is successful, Zed will download the server on the remote host and start it.
1. Once the Zed server is running, you will be prompted to choose a path to open on the remote server.
> **Note:** Zed does not currently handle opening very large directories (for example, `/` or `~` that may have >100,000 files) very well. We are working on improving this, but suggest in the meantime opening only specific projects, or subfolders of very large mono-repos.
For simple cases where you don't need any SSH arguments, you can run `zed ssh://[<user>@]<host>[:<port>]/<path>` to open a remote folder/file directly. If you'd like to hotlink into an SSH project, use a link of the format: `zed://ssh/[<user>@]<host>[:<port>]/<path>`.
## Supported platforms
The remote machine must be able to run Zed's server. The following platforms should work, though note that we have not exhaustively tested every Linux distribution:
- macOS Catalina or later (Intel or Apple Silicon)
- Linux (x86_64 or arm64, we do not yet support 32-bit platforms)
- Windows is not yet supported.
## Configuration
The list of remote servers is stored in your settings file {#kb zed::OpenSettings}. You can edit this list using the Remote Projects dialog {#kb projects::OpenRemote}, which provides some robustness - for example it checks that the connection can be established before writing it to the settings file.
```json
{
"ssh_connections": [
{
"host": "192.168.1.10",
"projects": [{ "paths": ["~/code/zed/zed"] }]
}
]
}
```
Zed shells out to the `ssh` on your path, and so it will inherit any configuration you have in `~/.ssh/config` for the given host. That said, if you need to override anything you can configure the following additional options on each connection:
```json
{
"ssh_connections": [
{
"host": "192.168.1.10",
"projects": [{ "paths": ["~/code/zed/zed"] }],
// any argument to pass to the ssh master process
"args": ["-i", "~/.ssh/work_id_file"],
"port": 22, // defaults to 22
// defaults to your username on your local machine
"username": "me"
}
]
}
```
There are two additional Zed-specific options per connection, `upload_binary_over_ssh` and `nickname`:
```json
{
"ssh_connections": [
{
"host": "192.168.1.10",
"projects": [{ "paths": ["~/code/zed/zed"] }],
// by default Zed will download the server binary from the internet on the remote.
// When this is true, it'll be downloaded to your laptop and uploaded over SSH.
// This is useful when your remote server has restricted internet access.
"upload_binary_over_ssh": true,
// Shown in the Zed UI to help distinguish multiple hosts.
"nickname": "lil-linux"
}
]
}
```
If you use the command line to open a connection to a host by doing `zed ssh://192.168.1.10/~/.vimrc`, then extra options are read from your settings file by finding the first connection that matches the host/username/port of the URL on the command line.
Additionally it's worth noting that while you can pass a password on the command line `zed ssh://user:password@host/~`, we do not support writing a password to your settings file. If you're connecting repeatedly to the same host, you should configure key-based authentication.
## Port forwarding
If you'd like to be able to connect to ports on your remote server from your local machine, you can configure port forwarding in your settings file. This is particularly useful for developing websites so you can load the site in your browser while working.
```json
{
"ssh_connections": [
{
"host": "192.168.1.10",
"port_forwards": [{ "local_port": 8080, "remote_port": 80 }]
}