Guides · Go further

Run agents on your own server

Run agents on a machine you reach over SSH, from the same diri window, and know what survives a dropped connection.

7 min readDevelopers
You will learn
  • How to add a server and start an agent on it
  • What diri installs there, and what it does not
  • What happens when the connection drops

1Before you start

You need a server you can already reach with ssh, a project folder on it, and an agent installed and signed in there. diri uses your normal SSH setup, including aliases from ~/.ssh/config, and never copies your local agent logins to the server.

Supported servers: Linux on x86_64 or arm64, and Macs with Apple silicon.

ssh devbox

If that works in Terminal, diri can use it too.

2Add the server

  1. Open Settings → Remote and click Add Host.
  2. Enter the SSH destination, for example devbox or [email protected], and click Save Host.

diri connects, checks the platform, uploads and verifies a small helper program, and tests whether sessions can survive a disconnect. It needs no tmux, no sudo and nothing preinstalled.

3Start a remote session

Open New Agent, click the folder row, and pick your server under Machine. Then choose a folder on it with Browse, pick an agent, and start.

The agent runs on the server. Its row in the sidebar works exactly like a local one.

4Check what survives a disconnect

A working connection does not mean the server keeps processes alive after you disconnect. diri tells you what it found:

native detach
Sessions keep running on their own after you disconnect.
user supervisor
diri uses a supervisor your account already has to keep them running.
non-persistent
The server may stop the session when the connection closes. Stay connected, or use a different server.

No mode survives the server itself restarting.

5Reconnect after a drop

On a server that keeps sessions alive, a dropped connection is harmless. When diri reconnects, it reattaches to the same session and redraws its screen. Do not start a duplicate agent just because the connection blinked.

Try it with a small throwaway task before you rely on it for long work.