TutorialBeta· About 20 minutes
Run Crew coding agents on a Linux server over SSH
By the end of this tutorial, a Linux server will run Crew agents that keep working when your SSH connection drops, show up on the Crew board next to your local agents, and that you can attach to from Edith or from a plain SSH session. You need Crew running on a Mac in the Edith beta, the Machines extension, and SSH access to the server. See Get Crew.
Add the server in Machines
Crew uses the same machine list as the Machines extension. If you do not have Machines yet, install it from Library.
- Open Machines from the sidebar and press Add machine.
- Choose From SSH config to pick a host you already set up in
~/.ssh/config, or Enter details. - For Enter details, fill in Display name, such as
box, Address and Username. Under Sign in with, choose SSH agent, Key file or Password. Passwords and passphrases are stored in your Mac's Keychain. - Press Test connection to confirm Edith can reach the server.
- Press Add machine.
A machine that is disabled in Machines is refused by Crew. Keep it enabled.
From the terminal
ed machines add box --host 198.51.100.4 --user piadded box target pi@198.51.100.4 auth SSH agentadd never dials the machine, so open it in Machines once to confirm Edith can connect. With a private key, add --key ~/.ssh/id_ed25519. Secrets such as a password are only read from stdin. See Machines and ed machines add.
Install the agent CLI on the server
Edith copies the agents engine to the server, not the agents themselves. SSH into the server, install the coding agent you want, such as Claude Code or Codex, and sign in to it there the usual way. You need your own plan or API key for it.
Start a Crew agent on the server
On the Crew page, press New agent (⌘N):
- Agent. Pick the coding agent you installed on the server.
- Machine. Pick
box. Machines that cannot run agents are dimmed and say Agents cannot run here or Cannot be reached right now. Press Check machines again after you fix one. - Space. Pick a space, or type a name and choose Create space.
To start a structured thread on the server instead, switch to Threads, press New thread, and pick box as the machine in the composer.
From the terminal
Pass an absolute folder on the server:
ed crew open /srv/app --machine box --agent codexed crew thread launch /srv/app --machine box --provider codex -- fix the build--machine takes a machine name, SSH alias, UUID or a unique prefix.
Let Edith install the engine
The first time you start an agent on the server, Edith:
- Asks the machine which platform it runs.
- Copies the matching engine to
~/.edith/agents/bin/edith-agentson the server. Crew carries engines for Linux on x86_64 and arm64. - Checks the copy and refuses an engine that does not match.
- Starts the engine detached from the SSH session, so it keeps running when you disconnect.
An engine that is already current is not copied again. The agent then shows up on the Crew board with box named on its card.
From the terminal
Check that the server's agents are listed:
ed crew ls --machine boxBefore the first agent starts, the server is listed with an empty agent list, not as a failure. In --json output each host also reports reachable, so a connection failure is distinct from a server that was reached.
Start the engine at login on the server
There is no launchd on Linux. The engine starts detached the first time an agent starts and keeps running after you log out of SSH, but not after the server reboots. To start it at login, run this on the server:
~/.edith/agents/bin/edith-agents service install --lingerThat writes a systemd user unit. --linger asks logind to keep it running while you are logged out. When the engine starts again, it reopens its workspaces, tabs and panes and resumes the agents it knows a conversation id for.
Open the agent from your Mac
Remote agents sit on the Crew board next to local ones, with the machine named on each card. Click a card to open the agent in a tab and type to it.
To reach it from a terminal on your Mac, open the agent's details panel (⌥⌘B) and press Copy SSH, then paste the line into any terminal. It has this form:
ssh -tt box -- '"$HOME/.edith/agents/bin/edith-agents" --session default agent attach w3:p1N --takeover'ed crew attach w3:p1N --machine boxattach hands your terminal to SSH and returns the attached process's exit status. ed crew command w3:p1N --machine box prints the line instead of running it.
Attach from a plain SSH session
You do not need Edith at all. SSH into the server and run the engine with no arguments:
ssh box~/.edith/agents/bin/edith-agentsIt shows a list of the server's agents. Pick one to attach.
Detach with ctrl+]
Inside an agent, press ctrl+] to detach. The agent keeps running on the server. Press ctrl+] twice to send the key to the agent instead.
Closing the SSH connection, or losing it, has the same effect: the engine owns the agent's terminal, so the agent keeps working and you attach again later.
Keep the engine and hooks current
These are terminal steps. After you update Edith, copy the new engine to every enabled machine that has an older one:
ed crew updateed crew update --machine box --restartAn engine that can hand its agents over to the new build does so in place. --restart restarts one that cannot; its agents resume when it starts.
Engine hooks let agents on the server report working, finished or waiting straight to the engine, which is faster than reading the screen:
ed crew integrations install --all --machine boxStart or resume the agent's session after installing so it loads the hook.
Next steps
- Keep agents running overnight
- One git worktree per agent
- Remote machines for environment variables and forwarded ports
- The agents engine
ed crew attachanded machines