Run Claude Code on a remote server
The short answer: install Claude Code on the server, sign in, and keep your sessions running there. amux then makes the server feel local: pair it once over SSH, and you start, answer and review its agents from your laptop or phone. SSH and tmux work for one server if you’re happy in a terminal. If you’d rather not look after a server, Claude Code’s cloud sessions run on Anthropic’s machines.
Where it goes wrong
You’re working on Tally, a small accounting app. Its test suite takes twenty minutes and spins up your laptop’s fans. Agents run it again and again. Your laptop also goes to meetings, home and on trains, and the agents stop every time it does.
You have a better computer for this: a Linux box, a cloud VM or a Mac mini in a
cupboard. Call it build. Getting agents running there is easy. Living with them is
the hard part.
Why it happens
Your laptop is where you work, but it’s a poor place for agents to run. A server fixes that, and swaps in a new set of needs:
- Everything the agent needs, on the server: your code, your tools and a signed-in Claude Code.
- Something to keep it running when nobody is logged in, and after a restart.
- An easy way in, so checking on an agent isn’t a chore.
There’s one more thing to decide. An agent on a server can do whatever its account can, so run it under an account that holds only what the work needs.
Without amux
SSH and tmux
The simplest setup, and one you can do today. Install Claude Code on the server, then:
ssh you@buildtmux new -s tallyclaudeRun /login the first time. If your connection drops,
the session keeps going,
and tmux attach -t tally takes you back. Every check on an agent starts with
connecting and finding its window, though, and on a phone that means a terminal app.
Remote Control
Run claude remote-control on the server, and you can reach it from
claude.ai/code or the Claude app.
It needs a Claude subscription rather than an API key, and it only lasts as long as
that process does, so run it under tmux or a service.
Cloud sessions
claude --cloud "fix the flaky sync test" starts a
cloud session on Anthropic’s
infrastructure, with no server of your own. It clones your code from GitHub and runs
in their environment, so it won’t have your machine’s tools, data or network.
With amux
Set up the server once. Install Claude Code and amux on it, and sign in:
curl -fsSL https://amux.sh/install | shclaudeRun /login in Claude Code, then give the server a name and tell amux where your
projects are:
amux config set host_name buildamux config set repositories '["~/tally"]'So that amux comes back after a restart, even if you never log in:
amux config set start_at_login truesudo loginctl enable-linger "$USER"Then, from your laptop, pair it. If you can ssh to the server without typing a
password, this is all it takes, and it’s free:
amux pair you@buildStart an agent on it from your laptop. In amux, press n, type the task, then
press Ctrl+S followed by h and pick build. Your repositories are offered as
the folder. You can also ask an agent you already have: “Start an agent on build to
run the full test suite.” Everything else works as it does locally, with build
named on the agent’s row:
Your laptop can sleep now, or leave the house, and the agents on build carry on.
When it wakes, it catches up.
Your phone pairs with each computer on its own. Run amux pair --qr on the server
and scan the code. To reach build when you’re out, use the relay with
Pro, or Tailscale,
which is free.
To go further, Running amux on a server covers the details, including sleep and running amux under your own service manager.
Last reviewed on 6 November 2026.
Next: An agent is waiting and you're away from your desk Use Claude Code from your iPhone