Updated for 2027 · checked against the official Claude Code docs

Cheapest VPS for Claude Code in 2027: Requirements, 7 Cheap Options & Setup

Want Claude Code working 24/7 without melting your laptop? You need a cheap VPS with at least 4 GB RAM. Here is what actually works, what it costs, and how to set it up in 10 minutes — from someone who runs his own servers.

Quick answer: the cheapest VPS for Claude Code that meets the official 4 GB RAM minimum is OVHcloud VPS-1 (about $4.54/mo). The best value is an 8 GB box: Contabo Cloud VPS 10 (about €4.40/mo on a 12-month term) or our VPS 8 ($5.99/mo, no prepay). Avoid 1–2 GB promo servers — they fall below the minimum.

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 & planRAMvCPUPriceMeets 4 GB minimum?Verdict for Claude Code
OVHcloud VPS-1 4 GB2 vCores$4.54/mo ✔ Yes Cheapest that qualifies; tight once tests run. Unlimited traffic + daily backup.
Contabo Cloud VPS 10 8 GB4 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 GB2 vCore≈€5/mo ✔ Yes Cheap and solid in Europe; DDR5 + big NVMe.
Hetzner CX23 4 GB2 vCPU€5.49/mo + IPv4 ✔ Yes Fastest CPU and a great API; IPv4 costs extra.
Cheap-VPS.org VPS 8 8 GB4 vCPU$5.99/mo ✔ Yes 8 GB sweet spot, no prepay, same renewal price.
Hostinger KVM 1 4 GB1 vCPU$6.49/mo (24-mo prepay) ✔ Yes Easiest panel; needs a 24-month prepay, renewals much higher.
RackNerd 1 GB promo 1 GB1 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 install and 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:

RequirementOfficial minimumWhat I'd actually pick on a VPS
Operating systemUbuntu 20.04+, Debian 10+, Alpine Linux 3.19+ (also macOS 13+, Windows 10 1809+ / Server 2019+)Ubuntu 24.04 LTS or Debian 12
RAM4 GB+8 GB if Claude also runs your tests, a dev server or Docker
CPUx64 or ARM642–4 vCPU; ARM64 servers (e.g. Hetzner CAX) work too
NetworkInternet connectionAny VPS; traffic use is tiny
ShellBash, Zsh, PowerShell or CMDBash (default on Ubuntu/Debian)
LocationAnthropic supported countriesCheck 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 install or 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 onRAM I'd use
Scripts, small Python/Go/PHP projects, docs4 GB
Node/React/Next.js app with dev server + tests8 GB
Docker Compose stack (app + Postgres + Redis)8 GB
Several repos / parallel Claude sessions, Java or Rust builds16–24 GB
Heavy CI-style workloads, many containers, local databases with real data32 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:

  1. The server — from about $4.50 a month (see the comparison table).
  2. 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 /sandbox in a session (or set sandbox.enabled to 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 .env files 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 top and watch st. 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/bin to your PATH. claude doctor shows 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 --text shows when it ends.
  • Alpine says not found — install bash and curl first (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.

Our VPS plans for Claude Code

The highlighted 8 GB plan is what I'd run Claude Code on. Need several repos or Docker-heavy projects? Go 24–32 GB. Full plan details and other hosts: cheap VPS hosting plans.

24 GB RAM VPS 24

$16.99/mo

$0.71 per GB RAM

  • 8 vCPU cores (KVM)
  • 24 GB dedicated RAM
  • 300 GB NVMe SSD
  • 20 TB bandwidth
  • 1 Gbps port
  • Full root access
  • IPv4 + IPv6 included
  • DDoS protection
  • Linux or Windows (BYO license)
  • No setup fee
Order now

32 GB RAM VPS 32

$21.99/mo

$0.69 per GB RAM

  • 10 vCPU cores (KVM)
  • 32 GB dedicated RAM
  • 400 GB NVMe SSD
  • 30 TB bandwidth
  • 1 Gbps port
  • Full root access
  • IPv4 + IPv6 included
  • DDoS protection
  • Linux or Windows (BYO license)
  • No setup fee
Order now

64 GB RAM VPS 64

$37.99/mo

$0.59 per GB RAM

  • 16 vCPU cores (KVM)
  • 64 GB dedicated RAM
  • 800 GB NVMe SSD
  • 40 TB bandwidth
  • 1 Gbps port
  • Full root access
  • IPv4 + IPv6 included
  • DDoS protection
  • Linux or Windows (BYO license)
  • No setup fee
Order now

128 GB RAM VPS 128

$69.99/mo

$0.55 per GB RAM

  • 24 vCPU cores (KVM)
  • 128 GB dedicated RAM
  • 1600 GB NVMe SSD
  • 50 TB bandwidth
  • 1 Gbps port
  • Full root access
  • IPv4 + IPv6 included
  • DDoS protection
  • Linux or Windows (BYO license)
  • No setup fee
Order now

Prices in USD, billed monthly, no long-term contract. Renewal price = the price you see. Taxes may apply depending on your country.

Claude Code VPS FAQ

What is the cheapest VPS for Claude Code?

OVHcloud VPS-1 (4 GB RAM, about $4.54/mo) is the cheapest plan from a major host that meets the official 4 GB minimum. For 8 GB, Contabo Cloud VPS 10 (about €4.40/mo on a 12-month term) or our VPS 8 ($5.99/mo, monthly) are the best value. See the comparison table.

How much RAM does Claude Code need on a VPS?

Anthropic lists 4 GB RAM as the minimum. Because your own tools (npm, Docker, test runners) run on the same server, 8 GB is the comfortable choice for most web projects, and 16 GB+ for several repos or heavy builds.

Can I run Claude Code on a 1 GB or 2 GB VPS?

It is below the official 4 GB requirement, and in practice the server runs out of memory as soon as Claude installs dependencies or runs tests. Use a 4 GB plan at minimum.

How do I log in to Claude Code on a headless VPS?

Run claude, press c to copy the login URL, open it in your laptop's browser, then paste the code back into the terminal. For scripts, claude setup-token creates a one-year token you set as CLAUDE_CODE_OAUTH_TOKEN.

Do I need a Claude subscription to use Claude Code on a VPS?

Yes. Claude Code needs a Pro, Max, Ultra, Team, Enterprise or Console account (the free claude.ai plan doesn't include it), or access through Amazon Bedrock, Google Cloud or Microsoft Foundry. The VPS is billed separately by your host.

Is it safe to run Claude Code on a VPS?

Safer than on your laptop if you set it up right: a non-root user, SSH keys only, a firewall, no production secrets on the box, and Claude Code's sandbox enabled (sudo apt-get install bubblewrap socat, then /sandbox).

Does Claude Code work on ARM servers?

Yes. Anthropic supports x64 and ARM64 processors, so ARM VPS plans such as Hetzner's CAX line work too.

Sources & further reading

  1. Claude Code docs — Advanced setup (system requirements, install)
  2. Claude Code docs — Authentication (headless login, setup-token)
  3. Claude Code docs — Sandboxing
  4. Anthropic — Supported countries
  5. Claude plans & pricing
  6. OVHcloud — VPS range
  7. Contabo — Cloud VPS
  8. Hetzner Docs — Price adjustment 2026
  9. Cheap VPS hosting compared — Sources & further reading

Where should we send your order details?

Enter your email to continue. We'll save your configuration so you can finish any time.

No spam. Only your order, invoices and a reminder if you don't finish.