Cheapest VPS for Claude Code compared (December 2026 prices)
Every plan below except the last meets Anthropic's 4 GB RAM minimum. Click a provider for the full review, real user feedback and hidden costs in my cheap VPS hosting comparison.
| Provider & plan | RAM | vCPU | Price | Meets 4 GB minimum? | Verdict for Claude Code |
|---|---|---|---|---|---|
| OVHcloud VPS-1 | 4 GB | 2 vCores | $4.54/mo | ✔ Yes | Cheapest that qualifies; tight once tests run. Unlimited traffic + daily backup. |
| Contabo Cloud VPS 10 | 8 GB | 4 vCPU | €4.40/mo (12-mo term) | ✔ Yes | Best value: 8 GB for the price of 4 elsewhere. Test CPU steal first. |
| netcup VPS 500 G12 | 4 GB | 2 vCore | ≈€5/mo | ✔ Yes | Cheap and solid in Europe; DDR5 + big NVMe. |
| Hetzner CX23 | 4 GB | 2 vCPU | €5.49/mo + IPv4 | ✔ Yes | Fastest CPU and a great API; IPv4 costs extra. |
| Cheap-VPS.org VPS 8 | 8 GB | 4 vCPU | $5.99/mo | ✔ Yes | 8 GB sweet spot, no prepay, same renewal price. |
| Hostinger KVM 1 | 4 GB | 1 vCPU | $6.49/mo (24-mo prepay) | ✔ Yes | Easiest panel; needs a 24-month prepay, renewals much higher. |
| RackNerd 1 GB promo | 1 GB | 1 vCPU | ≈$11–20/year | ✘ No | Great for VPNs, too small for Claude Code (below 4 GB). |
Prices are public list prices checked late Nov / early Dec 2026, excluding tax unless stated. 2026 brought several price hikes (Hetzner alone adjusted prices three times), so always confirm on the provider's site before you buy.
Why run Claude Code on a VPS at all?
Claude Code is Anthropic's agentic coding tool: it lives in your terminal, reads your repository, edits files, runs commands and tests, and keeps going until the task is done. You can run it on your laptop, so why pay for a server?
Because I kept closing my laptop lid in the middle of a long refactor. On a VPS, Claude Code keeps working while you sleep, commute or close the lid. Here's what you actually get:
- It runs 24/7. Start a long task inside
tmux, disconnect, and check back from your phone over SSH. - Your laptop stays clean and safe. An agent that runs shell commands is safer on a disposable server than on the machine with your passwords, photos and SSH keys. If something goes wrong, you rebuild the VPS in five minutes.
- Real Linux, close to production. Same distro, same Docker, same database as your servers — no "works on my Mac" surprises.
- Fast network.
git clone,npm installand Docker pulls run at data-centre speed, not hotel-Wi-Fi speed. - One box for several projects. Each repo gets its own tmux window and its own Claude session.
And it's cheap. As you'll see below, a server that meets the official requirements costs about the same as a sandwich per month.
Claude Code VPS requirements (official + real-world)
Anthropic's setup documentation lists these system requirements:
| Requirement | Official minimum | What I'd actually pick on a VPS |
|---|---|---|
| Operating system | Ubuntu 20.04+, Debian 10+, Alpine Linux 3.19+ (also macOS 13+, Windows 10 1809+ / Server 2019+) | Ubuntu 24.04 LTS or Debian 12 |
| RAM | 4 GB+ | 8 GB if Claude also runs your tests, a dev server or Docker |
| CPU | x64 or ARM64 | 2–4 vCPU; ARM64 servers (e.g. Hetzner CAX) work too |
| Network | Internet connection | Any VPS; traffic use is tiny |
| Shell | Bash, Zsh, PowerShell or CMD | Bash (default on Ubuntu/Debian) |
| Location | Anthropic supported countries | Check the supported countries list before you pick a region |
| Disk | — | 40 GB+ NVMe (repos, node_modules and Docker images add up fast) |
Two things the docs don't say but every operator learns the hard way:
- The model doesn't run on your VPS. Claude thinks in Anthropic's cloud; your server only runs the CLI, git, your build tools and your tests. That's why a small server works — and why RAM for your toolchain is what matters.
- 1–2 GB boxes are a trap. They fall below the 4 GB minimum, and the moment Claude runs
npm installor your test suite, the Linux OOM killer starts shooting processes. Those $1/month promo boxes are great for VPNs — not for this.
How much RAM does Claude Code need for your workload?
| What Claude works on | RAM I'd use |
|---|---|
| Scripts, small Python/Go/PHP projects, docs | 4 GB |
| Node/React/Next.js app with dev server + tests | 8 GB |
| Docker Compose stack (app + Postgres + Redis) | 8 GB |
| Several repos / parallel Claude sessions, Java or Rust builds | 16–24 GB |
| Heavy CI-style workloads, many containers, local databases with real data | 32 GB+ |
For general server sizing, my RAM guide for cheap VPS hosting covers databases, game servers and more.
What does Claude Code on a VPS really cost?
There are two separate bills:
- The server — from about $4.50 a month (see the comparison table).
- Claude itself — Claude Code needs a Pro, Max, Ultra, Team, Enterprise or Console account; the free claude.ai plan doesn't include it. You can also use it through Amazon Bedrock, Google Cloud or Microsoft Foundry. See claude.com/pricing for current plans.
The VPS is the small part of the bill, so don't over-optimise it. Saving $2 a month isn't worth it if the agent spends twenty minutes waiting on a slow, oversold CPU for every test run. Watch the hidden costs too: IPv4 fees, VAT, renewal hikes and long prepays.
How to set up Claude Code on a cheap VPS (10 minutes)
This is the setup I use on Ubuntu 24.04 / Debian 12. Replace dev with your username.
1. Create a normal user (never run an agent as root)
adduser dev
usermod -aG sudo dev
rsync --archive --chown=dev:dev ~/.ssh /home/dev
# log out, then: ssh dev@your-server-ip
2. Basic hardening + tools
sudo apt update && sudo apt -y upgrade
sudo apt -y install git tmux curl ufw unattended-upgrades
sudo ufw allow OpenSSH && sudo ufw enable
Also disable password login in /etc/ssh/sshd_config (PasswordAuthentication no). My first-hour checklist for a new VPS has the full list.
3. Install Claude Code
The recommended native installer for Linux (it auto-updates in the background):
curl -fsSL https://claude.ai/install.sh | bash
claude --version
claude doctor
If claude isn't found, open a new shell (the installer puts it in ~/.local/bin). Prefer packages? Anthropic also publishes signed apt, dnf and apk repositories, and an npm package (npm install -g @anthropic-ai/claude-code@latest, Node.js 22+). Don't use sudo npm install -g.
4. Log in from a headless server
Run claude inside your project. On a VPS there's no browser, so press c to copy the login URL, open it on your laptop, sign in, and paste the code back into the terminal. Credentials are stored in ~/.claude/.credentials.json with mode 0600.
For scripts or CI on the server, generate a one-year token with claude setup-token and export it as CLAUDE_CODE_OAUTH_TOKEN. Treat it like a password. With a Console API key, set ANTHROPIC_API_KEY instead.
5. Keep sessions alive with tmux
tmux new -s claude # start
cd ~/projects/my-app && claude
# detach: Ctrl+b then d · reattach later: tmux attach -t claude
Security: let the agent work without giving it the keys to everything
- Turn on the sandbox. On Linux, Claude Code's sandbox uses bubblewrap to limit what shell commands can write and where they can connect. Install the dependencies with
sudo apt-get install bubblewrap socat, then run/sandboxin a session (or setsandbox.enabledto true in~/.claude/settings.json). It's off by default, and the sandbox covers shell commands only, not MCP servers or hooks. - One server per trust level. Don't put your production database password or root SSH keys on the box where an agent runs. Give it a deploy key with access to one repo.
- Snapshots before big jobs. Most hosts let you snapshot a VPS in seconds. Take one before "refactor the whole codebase".
- Keep secrets out of git. Use
.envfiles listed in.gitignore, and rotate any token that ever lands in a commit. - Firewall + updates. Only SSH open; unattended security upgrades on. The red-flags checklist helps you avoid sketchy hosts in the first place.
How to choose the cheapest VPS for Claude Code
- RAM first, then CPU. 4 GB is the floor, 8 GB the sweet spot. Compare plans with the price per GB of RAM chart, not the sticker price.
- CPU steal matters for tests, not for Claude. An oversold node makes builds and test runs slow, so the agent waits longer. Run
topand watchst. If it stays above 10%, ask for a move or a refund. - Location = SSH comfort. Pick a region near you so typing over SSH feels instant. The model's speed doesn't depend on where your VPS is.
- IPv4 included? Some hosts now charge extra for IPv4, and an IPv6-only box can't reach some package mirrors.
- No long prepay. Monthly billing lets you resize when a project grows.
Common problems on a VPS
claude: command not found— open a new shell or add~/.local/binto your PATH.claude doctorshows what's wrong.- Processes getting killed / session freezing — out of memory. Check
dmesg | grep -i oom, add swap, or move to 8 GB. - Login asks again — your sign-in expired. Run
/login.claude auth status --textshows when it ends. - Alpine says
not found— installbashandcurlfirst (apk add bash curl).
Where our 8 GB plan fits
Full disclosure again: I sell VPS. Our VPS 8 (4 vCPU, 8 GB RAM, 100 GB NVMe, $5.99/month, no prepay) is the box I'd give Claude Code: enough RAM for your tests and Docker, on our own hardware and network (AS401132), with the renewal at the same price. If you only need the 4 GB minimum and want to save a dollar, take an OVHcloud VPS-1 or a Contabo box — honestly. The full cheap VPS hosting comparison covers every provider in detail.