DevRig

Guide · 25 Aug 2026

How to run Claude Code on a cloud server (and keep it alive)

Claude Code does its best work on long, autonomous runs — which is exactly what a laptop is bad at. Here's the full DIY recipe, including the parts that bite.

Why move it off the laptop at all

Three reasons come up over and over. The run dies when the lid closes or the network drops. The machine sleeps, throttles, or reboots for updates at exactly the wrong moment. And you can't check on a run from your phone if the run lives on hardware in your bag.

A server fixes all three. It also hands you a small operations job. This post is the honest version of that job.

Step 1 — a machine

Any Ubuntu 24.04 VPS with 4 GB of RAM or more works for a single agent; 8 GB is more comfortable once language servers, test runners and a build are in play. Pick a region near your git remotes rather than near you — the agent talks to GitHub far more than you talk to the agent.

Step 2 — the basics before anything else

# as root, once
adduser dev && usermod -aG sudo dev
rsync --archive --chown=dev:dev ~/.ssh /home/dev
ufw allow OpenSSH && ufw enable
# then disable password auth in /etc/ssh/sshd_config

Unattended upgrades, fail2ban, and a non-root user aren't optional on a box that will hold your repo checkouts and credentials. Budget an evening.

Step 3 — the agent

curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
npm install -g @anthropic-ai/claude-code
claude   # sign in with YOUR account

Sign in with your own Claude account. This matters beyond ideology: your usage, your limits, your history, no middleman marking up tokens.

Step 4 — surviving disconnects: tmux

tmux new -s agent
claude
# later, from anywhere:
ssh dev@your-server -t 'tmux attach -t agent'

tmux is the load-bearing piece. The SSH connection can die freely; the session keeps running server-side. The gotchas: scrollback is finite and precious, resize behavior between different client terminals is quirky, and if the server reboots, tmux and everything in it is gone — which is why step 5 exists.

Step 5 — the part everyone skips: backups

An agent with root on a box can wreck that box. Your provider's snapshot feature is the difference between an anecdote and a lost week. Know what it costs (often 20–30% of the instance price), know how old your newest restore point is (usually a day), and actually test a restore once.

What you end up with

A genuinely good setup — this is roughly what we ran ourselves before building DevRig. Also: a machine you now operate. OS updates, disk space, key rotation, the 2am page when the disk fills mid-run. None of it is hard. All of it is recurring.

The operated version

DevRig is this same shape with the operating included: a persistent Linux machine with root, a browser terminal that resumes exactly where you left it (no tmux ceremony), direct SSH when you want it, and continuous snapshots with rollback instead of a daily backup you hope works. Your agent, your model account, no token markup. We open in October — the waitlist locks the launch prices.

If you'd rather run it yourself, the recipe above is complete. It's a fine way to live — right up until you'd rather be writing code.