What is the best VPS for Claude Code in 2026?

Verified September 2026 picks for running Claude Code on a VPS: real prices, headless subscription auth, rate-limit math, and when managed hosting wins.

•

Published on

•

Do not index
The best VPS for Claude Code in 2026 is a plain 4 GB Linux box, and the old default answer is on ice: Hetzner's cheap CX plans are flagged not available as of early September 2026, so the safe DIY picks are now Vultr (2 vCPU / 4 GB, $20/mo) and DigitalOcean ($24/mo), with Contabo as the budget outlier and Oracle's free tier as the zero-dollar gamble. If you want the always-on box without doing server admin, Agent 37 runs a persistent Claude Code instance on your own Anthropic account from $1.99/mo.
Most "best VPS" listicles for this search were written before the June 2026 price shifts and skip everything that actually goes wrong on a server: how subscription login works on a box with no browser, what your Claude plan's rate limits do to a 24/7 machine, and when Anthropic's own cloud option makes the VPS unnecessary. This guide covers all of it, with prices checked in September 2026.
notion image

What Claude Code actually needs from a VPS

Claude Code is a terminal agent that calls Anthropic's API. The model runs in Anthropic's data centers; your server only runs a CLI, a git checkout, and whatever your build needs. That means no GPU, modest CPU, and a hard floor on memory.
Anthropic's official requirements are Ubuntu 20.04+ or Debian 10+ (x64 or ARM64), 4 GB+ of RAM, and an internet connection. Installation no longer needs Node.js: the native installer is one command, and it keeps itself updated in the background.
A sensible target shape: 2 vCPU, 4 GB RAM, 40 GB NVMe. Go bigger only if you run several agents side by side or your project's builds are heavy. For everything else, you are paying for uptime, not horsepower, which is why price and reliability decide this list, not benchmark charts.

The best VPS for Claude Code in 2026, compared

Live prices, checked September 2026:
Provider
Shape
Price
Why it makes the list
Vultr
2 vCPU / 4 GB
$20/mo
Cheapest mainstream 4 GB box
DigitalOcean
2 vCPU / 4 GB
$24/mo
Best docs and tooling
Hetzner CPX22
4 GB (EU)
EUR 19.99/mo
Great network; cheap CX line out of stock
Contabo
4 vCPU / 8 GB
~EUR 5.50/mo
Cheapest RAM, long-term contract
Oracle Free
up to 2 OCPU / 12 GB Arm
$0
Free, with reclaim risk
Hostinger KVM 2
~8 GB
$8.99 intro, $14.99 renewal
1-click template, renewal math
AWS t4g.medium
2 vCPU / 4 GB
~$25/mo
Fits existing AWS estates
MacStadium
Mac mini
from $109/mo
Only if you need macOS
Vultr is the value pick: the 4 GB cloud compute instance is $20/mo, provisioning is fast, and there are 30+ regions to keep latency to Anthropic's API low. Nothing exciting, which is exactly what you want.
DigitalOcean charges $24/mo for the same 4 GB shape and buys you the most polished dashboard, docs, and monitoring in the class. If you already run droplets, add one and move on.
Hetzner deserves an honest update, because every listicle still recommends it at EUR 4.49. That price is currently unorderable: Hetzner raised prices in June 2026 (the CX line actually rose least, to EUR 5.49 for the CX23), but the Cost-Optimized CX and CAX plans are flagged as not available on the pricing page as of early September, and they only ever existed in Germany and Finland. Until stock returns, the orderable 4 GB shape is the CPX22 at EUR 19.99/mo in EU regions; US locations only get the older CPX21 (3 vCPU / 4 GB) at EUR 32.49/mo. Still a superb host. If CX stock reappears at EUR 5.49, grab it; just confirm you can actually order before planning around it.
Contabo is the outlier: around EUR 5.50/mo gets you 4 vCPU and 8 GB, twice the RAM of boxes three times the price. The catch is the fine print: the best rate assumes a 24-month term, and provisioning and support are budget-grade. Fine for a personal box, think twice for client work.
Oracle Cloud's Always Free tier still offers up to 2 OCPUs and 12 GB of Arm compute at $0 (halved from 4 OCPUs / 24 GB in June 2026). The catches are real: free instances that sit under 20% utilization for a week can be reclaimed, and fully idle accounts get suspended. Treat it as a free experiment, not production.
Hostinger markets hard on this exact search and ships a 1-click Claude Code template. The KVM 2 plan is fine hardware, but do the renewal math: the headline $8.99/mo becomes $14.99/mo when the promo term ends, and the best intro price locks you in for two years.
AWS and MacStadium round out the table for narrower cases: a t4g.medium (~$25/mo) only makes sense when the box must live inside an existing AWS estate with its IAM and VPC rules, and MacStadium (from $109/mo) is the lane when you specifically need macOS and Xcode, which Linux boxes cannot fake.

How to set up Claude Code on a VPS

The basic install takes about fifteen minutes; hardening, backups, and updates are the ongoing cost:
  1. Provision Ubuntu 24.04 LTS. Create a non-root user, disable password SSH in favor of keys, and enable a firewall (ufw) that only admits SSH.
  1. Install Claude Code with the native installer: curl -fsSL https://claude.ai/install.sh | bash. No Node.js required.
  1. Authenticate. You have three official paths. Run claude and use the paste-code login: copy the URL into any browser, and when the browser can't reach the server's callback it shows a code you paste back into the terminal (built for SSH sessions). Or generate a long-lived token on your laptop with claude setup-token (valid one year, needs a paid Claude plan) and export it on the server as CLAUDE_CODE_OAUTH_TOKEN. Or set ANTHROPIC_API_KEY and pay per token instead of using a subscription.
  1. Start sessions inside tmux so they survive SSH disconnects. This is not folklore; Anthropic's own docs tell you to use tmux or screen for remote machines.
  1. For unattended runs, isolate first. --dangerously-skip-permissions refuses to run as root, and Anthropic's docs say to use it only in containers or VMs where Claude Code cannot damage the host. Our claude-code-docker repo packages exactly that: a pinned non-root image with persistent login and an opt-in default-deny egress firewall for YOLO mode.

The catch: your Claude plan matters more than the VPS

Claude Code is not on Anthropic's free plan. You need Pro ($20/mo), Max ($100 or $200/mo), or a metered API key. Whatever the listicles imply, this line item dwarfs the VPS: your real monthly cost is plan plus server, so agonizing over a $4 difference between hosts is noise.
The limits are the part VPS guides never mention. Your subscription usage is one pool shared between claude.ai and Claude Code, metered in 5-hour sessions with a weekly cap on top that resets at a fixed time. Two consequences for a 24/7 box:
  • An idle server consumes nothing. Claude Code sitting in tmux waiting for you burns zero quota, so keeping the box always-on is free in limit terms.
  • Autonomous overnight runs are exactly what eats the weekly cap. The weekly limit exists because people ran Claude Code around the clock. If you hit it, Anthropic lets Pro and Max users continue on prepaid usage credits at standard API rates.
Budget accordingly: a $20 VPS plus a $20 Pro plan runs serious daily coding, but 24/7 autonomous agents on one subscription will meet the weekly wall.

When you don't need a VPS at all

Two alternatives are worth ruling out before you rent a server.
Claude Code on the web (claude.ai/code) is Anthropic's own hosted option, included with Pro, Max, and Team plans as a research preview. Tasks run on Anthropic-managed VMs at no extra compute charge. It is genuinely good for fire-and-forget tasks, but it is not an always-on machine: sessions are GitHub-centric, you don't get a shell you own, and idle VMs are reclaimed. We compared it to self-hosting in depth in our Claude Code cloud guide.
Agent 37 (that's us) hosts the computer so you skip the server admin. One API call (POST /v1/instances with the agent37-claude-code template) provisions an always-on instance with Claude Code preinstalled; open the web terminal and run claude auth login, or pass CLAUDE_CODE_OAUTH_TOKEN or ANTHROPIC_API_KEY when you create it. Your login, files, and sessions persist on the instance until you delete it. You bring your own Anthropic account: Anthropic bills you for the model, we host the machine it runs on.
Pricing is the honest headline: a dedicated always-on 2 vCPU / 4 GB instance is $4.94/mo, or from $1.99/mo shared, about a quarter of the equivalent VPS compute. The included disk is small, expandable at $0.09 per GB per month, so size it to your repo before comparing totals; even at 80 GB it stays well under half the VPS price. New workspaces get a $1 starter credit, no card required. Agent 37 is backed by Y Combinator and SOC 2 Type I audited (Type II in progress). One honest caveat: at these prices there is no human support hotline; an AI bot filters support first.

What always-on Claude Code really costs per month

Path
Infrastructure
Plus your Claude plan
You still manage
Vultr / DigitalOcean VPS
$20 to $24
$20 to $200
Patches, firewall, auth, tmux, backups
Contabo
~EUR 5.50 (24-mo term)
$20 to $200
Same, on a budget host
Oracle Always Free
$0
$20 to $200
Same, plus reclaim risk
Agent 37
$4.94 dedicated (from $1.99 shared)
$20 to $200
Nothing; terminal in the browser
Claude Code on the web
$0
$20 to $200
Nothing, but VMs are reclaimed when idle
The plan column is the same everywhere, which is the point: pick your infrastructure on ops burden and reliability, not on a few dollars of compute.

FAQ

Can I run Claude Code on a $5 VPS?

In 2026, barely. The official minimum is 4 GB of RAM and mainstream $5 boxes ship 1 GB. The exceptions are Contabo (~EUR 5.50 for 8 GB on a 24-month term) and Oracle's free tier. Otherwise budget $20 to $24 for a mainstream box, or $4.94/mo for a dedicated managed instance on Agent 37.

Can I use my Claude Pro or Max subscription on a VPS?

Yes, and it's officially supported: use the paste-code login over SSH, or generate a one-year token with claude setup-token and export it as CLAUDE_CODE_OAUTH_TOKEN. Usage on the server counts against the same plan limits as your laptop.

Do I need a GPU or Node.js?

Neither. The model runs on Anthropic's side, so there is nothing to accelerate locally, and the native installer ships its own runtime. Node 22+ only matters if you insist on installing via npm.

How do I keep Claude Code running after I close SSH?

Start it inside tmux (or screen). Anthropic's docs recommend exactly this for remote machines: reattach with tmux attach and the session is where you left it.

Does Anthropic block VPS or datacenter IPs?

There is no published policy against datacenter IPs, and the community runs Claude Code on every major cloud without issue. You do need an Anthropic account in a supported country.

Is Agent 37 a VPS?

Not literally. It is a managed instance with kernel-level isolation (gVisor); the $4.94 dedicated tier reserves the full 2 vCPU / 4 GB shape around the clock, while the $1.99 shared tier bills the shape's monthly average. You get a browser terminal and full workspace control, but not root on the host. In practice the difference is that Claude Code is already installed, authenticated once, and always-on.
If the answer to "where should Claude Code live" is "not my laptop", you have two good options: rent a 4 GB box from the table above, spend fifteen minutes on install and own the upkeep, or deploy a persistent Claude Code instance on Agent 37: always-on, from $1.99/mo, provisioned in one API call, with a $1 credit to try it on.
Vishnu

Written by

Vishnu

Founder at Agent37, which runs managed hosting for OpenClaw and Hermes agents for 1,000+ users. Writes about what actually breaks when you leave an AI agent running.