A coding agent on your laptop stops the moment you close the lid. Which is fine for a quick edit — and quietly frustrating the moment you want it to grind through a long refactor, churn a test suite, or keep going while you go do something else. Move it to a server and that limitation just disappears: it works while you sleep, survives your wifi dropping, and hands you the result when you're back.
What "on a server" actually buys you
- It doesn't stop. A long task runs to completion regardless of your laptop.
- Clean room. The agent gets a reproducible environment; your machine stays free of build junk and half-installed dependencies.
- Isolation. An agent with shell access is powerful. Far better it has that power on a throwaway box than next to your photos and SSH keys.
That last point is underrated: a VPS is the safer home for an autonomous agent, precisely because it's separate.
Sizing it right
The agent itself is light — it calls a model over an API, so the thinking happens elsewhere (the same reason most AI agents need little RAM). What actually consumes resources is your project's toolchain: a big build, a heavy test run, a local database. So size for the project, not the agent:
- 2 GB / 2 cores — comfortable for the agent + a git checkout + light builds.
- 4 GB — a safe default for real projects with proper test suites.
- More only if your build is genuinely hungry or you run several agents at once.
Getting it running
SSH in, set up your toolchain and the agent (Claude Code, Cline's CLI, aider — whichever you use), clone your repo, and export your API key:
export ANTHROPIC_API_KEY=... # or your provider's key
cd ~/myproject
Now the key trick — don't run it in a bare SSH session, or it dies when you disconnect. Run it inside tmux:
sudo apt install -y tmux
tmux new -s agent
# inside tmux: start your coding agent, point it at the task
# then detach with: Ctrl-b, then d
Detach, close your laptop, go to lunch. The agent keeps working on the server. Come back and tmux attach -t agent to see what it did. For scheduled, unattended runs (e.g. a nightly maintenance pass), wrap it in a systemd service instead — same pattern as keeping any process alive.
The honest caveats
- Give it a sandbox, not the keys to the kingdom. Use a non-root user, keep it in a git repo (every change reviewable and revertible), and don't put production credentials on the box. Autonomy plus shell access plus carelessness is how accidents happen.
- Watch your token spend. A long-running agent calling a model in a loop costs real API money — set limits and check in. The server is cheap; the inference is what adds up.
- It's not magic. A background agent is great for well-scoped, verifiable tasks. Point it at something vague and unattended and you'll come back to confident nonsense. Scope tightly.
Within those rails, a coding agent on its own server is a genuinely useful pattern — your work continues whether or not you do. Spin up a 4 GB box, drop in tmux and your agent, and let it cook. The agent can even rent the server itself over MCP if you want the whole loop autonomous.