Claude Code VPS requirements: we ran up to 24 sessions on simulated 1 GB to 8 GB servers
If your code lives on the VPS, start at 2 vCPU and 4 GB. If the server only runs Claude Code, 1 vCPU and 2 GB handles 3–5 sessions. We ran 2 to 24 sessions at once on simulated VPS sizes and measured memory, CPU and turn times.
On this page
- How we tested
- Results on simulated servers from 1 vCPU / 1 GB to 16 vCPU / 16 GB
- Each extra session adds about 120 MB of RAM
- CPU only spikes when sessions start together
- At 24 sessions, each turn went from 6.5 to 23 seconds
- Most setups put your code on the server, one keeps it local
- Code on the server: start at 2 vCPU / 4 GB, 4 vCPU / 8 GB with a database
- Claude Code only: start at 1 vCPU / 2 GB, 2 vCPU / 4 GB is the sweet spot
- A cloud VPS exits through a data center IP
- Which size to buy for each setup
How big a VPS you need for Claude Code depends on where your code lives. Most people SSH in and keep the repository on the server, and then the project sets the size: a small frontend project with two or three sessions fits on 2 vCPU and 4 GB, a project with a database or several projects at once wants 4 vCPU and 8 GB, and 1–2 GB machines tend to run out of memory during installs. If your code stays on your own computer and the server only runs Claude Code, 1 vCPU with 2 GB handles 3 to 5 sessions and 2 vCPU with 4 GB handles about 10. The numbers below come from a December 2 test where we ran 2 to 24 Claude Code sessions at once on simulated 1, 2, 4 and 8 GB servers.
- About 120 MB of RAM per session. Memory grew in a straight line with session count, peaking at 2.9 GB for 24 sessions. That's with Claude Code's built-in file and shell tools turned off, so no project ran on the server.
- CPU is rarely the limit. Averaged over a whole conversation, each session used 0.04 to 0.08 of a core. With six sessions on one core, the slowest tenth of later turns (the p90) went from 2.1 to 3.8 seconds to start answering.
- At 24 sessions everything slowed down, and we don't know why yet. Turns took about 6.5 seconds at 16 sessions and about 23 seconds at 24, on 4 cores and on 16.
- If your code lives on the server too, budget for it separately. A freshly generated Next.js app needed about 0.7 GB to install its dependencies and about 0.7 GB again to build, as much as five or six sessions.
How we tested
We're building an app that runs Claude Code on a server (more on it under the three setups below), so we needed to know how many sessions each server size could carry.
- An Ubuntu container on our dev machine with Claude Code 2.1.333 installed. We added 200 ms of latency to the server's outbound traffic to mimic a server on the far side of an ocean from Anthropic. Test traffic left through the dev machine's proxy.
- Docker limits of 1 core with 700 MB, 1 core with 1.6 GB, 2 cores with 3.5 GB, and 4 cores with 7.4 GB, standing in for 1, 2, 4 and 8 GB VPS plans after the 300–400 MB a real VPS spends on its own OS. A 16-core, 16 GB run served as a control.
- N sessions started together, each running four back-to-back turns. Every turn pasted 16 KB of source code and asked Claude to name the two riskiest spots, which grew the context to about 40,000 tokens. All sessions used one subscription account and the Haiku model, which streams fastest and loads the CPU the most.
- We recorded peak memory (excluding the OS and file cache), CPU every half second, and for each turn the time to the first streamed token and to the end of the reply. A separate run kept one session going for 20 turns, up to 230,000 tokens of context.
That workload is far heavier than real use. People read replies and wait on commands, so 24 sessions all streaming nonstop is close to a worst case.
There are limits to what this shows. It's a container, not a real VPS, and the OS overhead is an estimate. Other builds were running on the dev machine, so the CPU figures lean pessimistic. Each configuration ran once. We only tested Haiku and short four-turn sessions; Sonnet and Opus stream more slowly, so they should load the CPU less, but we didn't measure them. Claude Code's built-in file and shell tools were turned off, so no project commands ran on the server.
Results on simulated servers from 1 vCPU / 1 GB to 16 vCPU / 16 GB
| Size · sessions | Peak memory (MB) | CPU avg / p95 (cores) |
|---|---|---|
| No limit · 1 (2-turn smoke test) | 141 | 0.07 / 0.29 |
| 1 vCPU 1 GB · 2 | 268 | 0.07 / 0.26 |
| 1 vCPU 1 GB · 3 | 459 | 0.12 / 0.45 |
| 1 vCPU 2 GB · 4 | 510 | 0.18 / 0.90 |
| 1 vCPU 2 GB · 6 | 759 | 0.35 / 1.02 |
| 2 vCPU 4 GB · 8 | 1,000 | 0.49 / 1.84 |
| 2 vCPU 4 GB · 12 | 1,492 | 0.62 / 1.96 |
| 4 vCPU 8 GB · 16 | 1,927 | 1.01 / 3.74 |
| 4 vCPU 8 GB · 24 | 2,875 | 1.72 / 2.36 |
| 16 vCPU 16 GB · 24 | 2,900 | 1.93 / 2.53 |
Every turn in every run completed. Nothing errored, and the kernel never killed a process for running out of memory. The CPU and 24-session sections below look at response times for turns 2 to 4 only. First turns include Claude Code's own startup and ranged from 6 to 19 seconds across runs, slower when many sessions launched together.
Each extra session adds about 120 MB of RAM
The Claude Code binary takes about 100 MB that all sessions share (the chart leaves it out), and each session adds roughly 120 MB on top. After the OS takes its share, a 2 GB VPS has room for five or six sessions, and a 4 GB one for well over ten.
Long conversations barely move the number. Our 20-turn session grew from about 190 MB to about 260 MB for the whole process, shared binary included, as its context reached 230,000 tokens, then leveled off.
Open sessions keep their memory even when nobody is using them. After the test we left all 24 sessions idle for 30 seconds and memory hardly dropped.
CPU only spikes when sessions start together
Averaged over a whole conversation, each session used 0.04 to 0.08 of a core. Idle ones use almost nothing: 24 idle sessions together came to about 0.2 of a core.
The CPU maxed out only in the seconds when sessions launched and streamed at once. With four sessions on one core, the p90 time to first token on later turns was 2.1 seconds; with six it was 3.8, while the median didn't move, so the occasional turn ran a second or two slow. Twelve sessions on two cores also peaked at 2 cores, with a p90 of 2.5 seconds. From those two runs we budget about five concurrent sessions per core, work out the memory limit too, and go with whichever is lower.
At 24 sessions, each turn went from 6.5 to 23 seconds
Up to 16 sessions, a turn took about 6.5 seconds from sending to the end of the reply, with the first token after 1.7 seconds. At 24 sessions a turn took about 23 seconds and the first token arrived after 10. The server was using only about 2 cores and had more than half its memory free, and rerunning on 16 cores with 16 GB gave the same result.
We haven't pinned down the cause. The likeliest explanation is that one account sending that many requests at once gets throttled, but we couldn't confirm it: the API time Claude Code itself logged stayed around 6.5 seconds per turn at 24 sessions, so the extra 17 or so seconds happened outside the requests it timed. The test traffic also went through our dev machine's proxy, which we can't rule out.
What we can say is that 16 sessions ran normally, 24 slowed down badly, and more CPU and RAM didn't help; 20 is our estimate of where it tips. To run more than 20 at once, we would add a second server with its own account instead of signing two accounts in on one VPS (accounts on one machine share one IP address, as we cover in using multiple Claude Code accounts), though we haven't tested whether the split restores the speed. That many sessions also burn through the 5-hour window and weekly limit quickly.
Most setups put your code on the server, one keeps it local
There are three common ways to use Claude Code on a VPS:
- SSH in and run Claude Code inside tmux. Claude Code and your repository both live on the server, so every file read, shell command and dependency install happens there. tmux keeps sessions alive when the SSH connection drops.
- Use an SSH session in the Claude desktop app. The desktop app installs Claude Code on the remote machine the first time you connect, and you pick a project folder on that machine, so the project runs on the server just as in the first option.
- Use Claude Capsule from AIMacMini. Claude Code runs on the server, but file edits and commands are sent back to your own computer, where your project, builds and tests stay. The server runs Claude Code and nothing else, which is what we measured above. It opens a browser on the server (about 500 MB) when you sign in to Claude, so 1 GB is too small and 2 GB is the minimum, and the app suggests how many sessions each server can carry using the table below. Claude Capsule isn't available for download yet.
Code on the server: start at 2 vCPU / 4 GB, 4 vCPU / 8 GB with a database
Claude Code's requirements say 4 GB of RAM. We read that as sized for the machine you develop on, which also installs packages, compiles, runs tests and may host a database.
On December 4 we generated two empty projects on our dev machine and measured them: a Vite + React app peaked at about 170 MB while installing dependencies and about 100 MB while building, and a Next.js app at about 700 MB and 670 MB. Those are one-page starter apps, and build tools spawn workers based on core count, so the numbers will shift on a small VPS. Real projects, plus a database and a dev server, need more. The 120 MB per session above was measured with Claude Code's own tools off; in an SSH setup each session also starts shells, ripgrep for code search and any MCP servers you've installed, which we didn't measure.
Putting those numbers together, here's what we'd buy:
| Your project | Suggested size |
|---|---|
| A small frontend or scripting project, 2–3 sessions at once | 2 vCPU / 4 GB |
| A database, Docker, or several projects at once | 4 vCPU / 8 GB |
| Stuck with a 1–2 GB machine | Add about 2 GB of swap first so installs and builds don't get killed |
Claude Code only: start at 1 vCPU / 2 GB, 2 vCPU / 4 GB is the sweet spot
When your code stays local, we budget memory as 0.4 GB for the OS, 0.1 GB for the binary and 0.2 GB per session (leaving room for long conversations), budget CPU at about five sessions per core, and take the lower of the two:
| VPS size | Sessions open at once | Notes |
|---|---|---|
| 1 vCPU / 1 GB | About 2 | Runs, with no headroom; updating or installing anything with sessions open can run out of memory, so add swap |
| 1 vCPU / 2 GB | 3–5 | Minimum |
| 2 vCPU / 4 GB | About 10 | Recommended. Twelve sessions streaming nonstop stayed fast in our test |
| 4 vCPU / 8 GB | 15–20 | Several projects in parallel; beyond that, see the 24-session results above |
A 20 GB disk is plenty. A Claude Code version is about 360 MB and the OS about 1 GB, so with conversation logs you use two to three GB. We tested mostly on Ubuntu 24.04; Claude Code also supports Ubuntu 20.04+, Debian 10+ and Alpine Linux 3.19+. Installing it on a server works the same as on a laptop, with one command, as in our Claude Code install guide.
A cloud VPS exits through a data center IP
Lookup sites flag a cloud VPS's default IP as hosting right away, so a residential or home-broadband VPS is the easier pick. If you already have an ordinary cloud server, you can route it through one of our static ISP or home broadband IPs as a fixed exit; our post on data center vs. residential IPs shows how to tell them apart.
Which size to buy for each setup
If you SSH in and keep your code on the server, buy 2 vCPU / 4 GB for a small project and 4 vCPU / 8 GB with a database or several projects. If the server only runs Claude Code, 1 vCPU / 2 GB carries 3 to 5 sessions and 2 vCPU / 4 GB about 10. If you need more than 20 sessions at once, skip the upgrade and split them across two servers, each with its own account. We explained why Claude Capsule keeps Claude on one fixed server in We Built Claude a Capsule.
