- Claude Code runs in the terminal while the model answers from Anthropic's servers, so you do not need a GPU. You need Linux on KVM: the documentation asks for at least 4 GB of RAM, an x64 or ARM64 processor and Ubuntu 20.04+ or Debian 10+.
- For one agent take 2 cores, 4 GB and an SSD of 40 GB or more. Half of such plans cost less than $22.78 a month, about $273 a year, and a quarter cost less than $14. Docker and parallel sessions need 8–16 GB.
- Run the agent as a separate user inside tmux, keep the key in a file with 600 permissions and leave only SSH open to the outside. The session then survives a closed laptop, and an agent's mistake does not touch the rest of the system.
Plans with these specs under $6 almost always come with a catch: a year paid up front, a setup fee or a server without its own IPv4 address. That is why they are not in the list above, and in the section on traps I will show how to spot these terms on a host's website.
Why keep Claude Code on a server rather than a laptop
On a laptop the agent lives only while the lid is open. Close it in the middle of a long task — a test run, a dependency upgrade, moving a module to a new library version — and the work stops. On a server the session runs inside tmux: you disconnect, reconnect in the morning and see where the agent stopped. The TransIP guide to Claude Code on a VPS recommends the same approach.
The second reason is isolation. The agent runs commands in a terminal: it installs packages, starts builds and edits files. Your work laptop also holds personal documents, keys to other projects and passwords saved in the browser. On a separate server the agent sees only what you put there, and a broken environment is easier to recreate than to repair.
The third is automation. In non-interactive mode, claude -p "task" runs one instruction and exits, and with --output-format json it hands the answer to a script, as the documentation describes. Such a call fits nicely into cron or a build step, which is why the agent's server often doubles as a server for a CI runner.
Which server fits your work?
Claude Code itself weighs almost nothing. The official setup page asks for 4 GB of RAM, an x64 or ARM64 processor and Ubuntu 20.04+, Debian 10+ or Alpine 3.19+; the TransIP guide gives the same 4 GB floor. Everything above that is eaten by your project: npm install, compilation, a test database in Docker. So pick the server by the heaviest command the agent will run.
One agent, one project
Scripts, a Python or Node.js backend, a website without a heavy build.
- 2 vCPU
- 4 GB
- SSD from 40 GB
- KVM
This is exactly the documented minimum. There is enough memory for the agent, git and an editor, and a small project's tests run without swapping. If the frontend build dies from lack of memory, that is the first sign it is time for 8 GB.
Docker and a full test run
The project starts with docker compose, a database and a queue; tests take minutes.
- 4 vCPU
- 8 GB
- NVMe from 80 GB
- KVM
Images, layers and the dependency cache quickly take up tens of gigabytes, so the disk matters here as much as memory. NVMe noticeably speeds up installing dependencies. Docker runs on KVM, while under container virtualisation it often fails to start; more on the VPS for Docker page.
Several agents in parallel
Two or three agents on separate branches of one repository, each with its own tests.
- 4+ vCPU
- 16 GB
- NVMe from 160 GB
- KVM
Each session is a separate process with its own builds, and the load peaks add up. We would count it like this: one session with tests needs 4 GB, and each additional one another 4 GB. That is our rule of thumb, not a documented requirement, so check it with free -h while the work is in full swing.
Hourly billing is handy when you need a server for an evening or for one overnight job. Create the server, give the agent its instruction, check the result and delete it — you pay only for the hours that passed. For 1,185 of the 1,838 hourly plans the host offers an API, so a script can create and delete the server. When this beats monthly billing is covered in the handbook: when paying by the hour is worth it.
Chart data
| RAM | Plans | A quarter cheaper than | Median | Median, hourly |
|---|---|---|---|---|
| 4 GB | 2,667 | $14.00 | $22.78 | $22.09 (265) |
| 8 GB | 3,116 | $23.51 | $39.99 | $40.01 (311) |
| 16 GB | 2,464 | $40.95 | $70.00 | $79.99 (289) |
| 32 GB | 1,584 | $70.25 | $116.03 | $154.99 (216) |
We would start with 4 GB on hourly billing and move up only when memory runs short. At 4 and 8 GB hourly plans cost the same as ordinary ones, while at 16 GB and above they are already 14–34% more expensive. If the server runs around the clock, a large plan is cheaper on monthly billing.
Five mistakes that make an agent on a server work badly
- A 2 GB plan "to start with"
Claude Code will start on it, but the first build with
npm installor compilation hits the memory ceiling, and the system starts killing processes. The documentation names 4 GB as the minimum.How to tell:
dmesgshows "Out of memory: Killed process" lines, and tests break off with no error in the code. - Container virtualisation instead of KVM
On OpenVZ and LXC the server has no kernel of its own. The agent itself works, but Docker for a test database often will not start. Among plans with 4 GB or more the catalog has about 400 of these.
How to tell: the plan description says OpenVZ, LXC or "container";
systemd-detect-virtanswersopenvzorlxc. - A server without its own IPv4
Such plans are cheaper but work over IPv6 only, and as of 17.11.2026 github.com has no IPv6 address — we checked with a DNS query. Cloning simply never starts. More in the handbook on IPv4 and IPv6 on a server.
How to tell: "IPv6 only" or "NAT" in the plan name;
curl -4 ifconfig.megets no answer on the server. - The agent running as root
Root has no limits: one wrong command and the whole system is broken. The documentation specifically warns that the no-prompts mode
--dangerously-skip-permissionsrefuses to run as root and is meant only for isolated containers.How to tell: the shell prompt ends in
#rather than$. - The API key in the repository or the shell history
A line like
export ANTHROPIC_API_KEY=…typed in the terminal stays in~/.bash_history, and a.envfile in the project can be committed by the agent by accident. A leaked key spends your money until it is revoked.How to tell:
grep -r ANTHROPIC ~/.bash_history ~/projectsfinds something.
How to set up the server in 20 minutes
The commands below are for Ubuntu 22.04 or 24.04. On Debian they are the same; on Alpine use apk instead of apt and install bash and curl first, because the installer will not work without them.
- Create a separate user
The agent will run as this user, and root stays for system maintenance only.
adduser dev mkdir -p /home/dev/.ssh && cp ~/.ssh/authorized_keys /home/dev/.ssh/ chown -R dev:dev /home/dev/.ssh - Close everything except SSH
The agent often starts a dev server on port 3000 or 8000. Without a firewall the whole internet can see it. View it through a tunnel instead:
ssh -L 3000:localhost:3000 dev@server. The other first steps are in the handbook on VPS security.ufw allow OpenSSH ufw enable - Install git, tmux and Claude Code
The official installer updates the program in the background on its own. The project's README marks the npm install as deprecated, and Claude Code itself does not use Node.js to run, though your project may of course need it.
apt install -y git tmux su - dev curl -fsSL https://claude.ai/install.sh | bash claude --version - Sign in or pass a key
You need a Pro, Max, Team or Enterprise subscription or a Console account. When you sign in over SSH no browser opens: copy the link from the terminal into the browser on your laptop and paste the code back. For scripts, an API key or a long-lived token from
claude setup-tokenis more convenient, stored in a file only your user can read.mkdir -p ~/.config && install -m 600 /dev/null ~/.config/claude.env nano ~/.config/claude.env # ANTHROPIC_API_KEY=... set -a; . ~/.config/claude.env; set +a - Give access to the one repository it needs
Do not copy your personal SSH key to the server. Create a separate key and add it in the repository settings as a deploy key: if the server is broken into, only one project is affected.
ssh-keygen -t ed25519 -f ~/.ssh/repo_deploy -N "" cat ~/.ssh/repo_deploy.pub - Run the agent inside tmux
To leave the session without stopping it, press Ctrl+B, then D. To come back, run
tmux attach -t claude, and to continue the last conversation with the agent,claude --continue.tmux new -s claude cd ~/projects/app && claude - Parallel tasks go into separate worktrees
Two agents in one folder overwrite each other's files. The
--worktreeflag creates a separate copy of the repository on its own branch, as the documentation advises; the mechanism is also described in the git manual. Each tmux window gets its own task.claude --worktree fix-login # window 1 claude --worktree feature-export # window 2 - Save work more often than you take snapshots
The main copy of the agent's work is what it pushes to a branch. A server snapshot before big changes helps restore the environment, not the code. How a snapshot differs from a backup is covered in the handbook on VPS backups.
git push -u origin HEAD
4 or 8 GB? If the project builds without Docker and the tests take less than a couple of minutes, start with 4 GB on hourly billing. If the project has docker compose or you want to keep two agents running at once, take 8 GB with NVMe.
Before ordering, look for the word KVM in the plan description: whether Docker works depends on it.
If you need the agent as a build step rather than in a terminal, see how to set up CI/CD on your own server, and read what VPS plans cost in 2026 across the whole catalog. A similar breakdown for a light load is the article on which server to take for a Telegram bot.
Prices are taken from hosts' websites and converted at the Central Bank of Russia rate. The live blocks refresh every hour, so their figures may differ from the text. Medians and plan counts are from the accsly.io catalog as of 17.11.2026. All matching plans are on the VPS for Claude Code page; requirements and commands follow the Claude Code documentation.