TKVibes Blog All topics RSS
Browse topics

Best VPS for Claude Code and AI Agents in 2026

Updated 2026-09-2413 min read

Use a 4 GB VPS for one Claude Code session or a lightweight AI agent that calls a hosted model API; Anthropic's current Claude Code requirement is 4 GB RAM. Choose 8 GB when you need parallel sessions, OpenHands Docker sandboxes, or several services, and do not buy a CPU-only VPS expecting fast local inference from a large model.

The useful question is not which VPS brand has the loudest discount. It is whether the server will run an API client, an isolated coding sandbox, or the language model itself. Those are three different workloads. Claude Code's official setup page now specifies 4 GB or more of RAM, so a 4 GB server is the defensible floor for one session. OpenHands adds Docker containers and benefits from 8 GB. Local inference is different again: model weights and context compete for memory, while a cheap virtual CPU limits generation speed.

I re-checked the official Claude Code documentation, eight project repositories through the GitHub API, and the live Hostinger India VPS page on 24 September 2026. The prices below are dated monthly equivalents, not a promise about your checkout total.

The short answer: choose the VPS by workload

WorkloadSensible starting RAMCPU and diskHostinger plan checked 24 Sep 2026Main constraint
One Claude Code session4 GB1 vCPU, 50 GB NVMeKVM 1: ₹599/month displayed, ₹999/month renewalOfficial 4 GB minimum leaves little room for other services
Lightweight API-based agent4 GB1-2 vCPU, 50 GB+KVM 1Logs, repositories, and subprocesses grow over time
OpenHands or parallel coding sessions8 GB2 vCPU, 100 GB NVMeKVM 2: ₹799/month displayed, ₹1,199/month renewalDocker sandboxes and concurrent processes
Agent plus a small local model8-16 GBMore CPU helps; watch model and context memoryKVM 2 or largerCPU inference speed and memory headroom
Interactive large local modelGPU serverGPU VRAM matters more than VPS RAMNot these CPU-only plansA general-purpose VPS is the wrong product

My default is simple. Buy 4 GB for a single remote-model coding agent. Buy 8 GB if the server also runs Docker workloads, n8n, a database, or more than one coding session. The extra KVM 2 capacity cost ₹200/month on both the displayed and renewal figures when checked, which is ₹2,400 over 12 monthly equivalents. That is useful arithmetic, but Hostinger bills selected terms upfront. Confirm the term, taxes, and final total in checkout.

Claude Code VPS requirements and installation

Anthropic's official Claude Code setup page listed these requirements on 24 September 2026:

  • Ubuntu 20.04+, Debian 10+, or Alpine Linux 3.19+ on Linux
  • x64 or ARM64 processor
  • 4 GB or more RAM
  • an internet connection and a supported country
  • Bash, Zsh, PowerShell, or CMD

The native installer is now the recommended Linux path. It does not require you to build a Node application on the server:

curl -fsSL https://claude.ai/install.sh | bash
claude doctor
claude

Read an installer before piping it into a shell if your change-control policy requires that. Anthropic also documents an npm installation, but the current page says npm package version 2.1.198 and later requires Node.js 22 or newer. The native installer avoids turning Node version management into a VPS prerequisite.

Claude Code is interactive, so I run it inside tmux rather than pretending a terminal tool is a web daemon:

sudo apt update
sudo apt install -y tmux git ripgrep
mkdir -p ~/work && cd ~/work
tmux new -s claude
claude

Detach with Ctrl-B, then D. Reconnect later with:

tmux attach -t claude

Authentication still happens through Claude Code's supported flow. Do not copy browser cookies or another person's token onto a remote server. Also check Anthropic's current account, location, and usage terms before designing unattended automation around an interactive product.

What 4 GB and 8 GB actually buy

A server advertised as 4 GB does not give one process all four gigabytes. Linux, SSH, monitoring, package updates, filesystem cache, and any Docker daemon use part of it. Anthropic's 4 GB requirement therefore supports the conclusion that KVM 1 is a starting floor, not that it has 4 GB spare for Claude Code.

Use measurements instead of a generic “agents per server” ratio:

free -h
df -h /
ps -eo pid,user,rss,comm --sort=-rss | head -20
systemd-cgtop --depth=2

RSS is shown in KiB. This command converts the top processes to MiB without guessing:

ps -eo rss,comm --sort=-rss \
  | python -c 'import sys; next(sys.stdin); [print(f"{int(x.split()[0])/1024:8.1f} MiB  {x.split(maxsplit=1)[1]}") for x in sys.stdin if x.split()]'

For Docker-based agents, measure containers separately:

docker stats --no-stream
docker system df
docker ps --size

The disk check matters. Coding agents clone repositories, install dependencies, create build artifacts, and leave logs. A 50 GB disk can be enough for one active project, but free space can disappear through container layers and package caches. Alert before the filesystem is full; an agent failing halfway through a write is a worse warning system.

The 8 GB plan buys operational margin. It does not make a 2 vCPU server equivalent to a workstation. Parallel test suites, TypeScript builds, browser automation, and container image builds can saturate CPU even when memory looks comfortable. Watch load and pressure during a real task:

uptime
vmstat 1 10
cat /proc/pressure/cpu
cat /proc/pressure/memory

These commands are the reproducible evidence I would collect before resizing. Sustained CPU pressure argues for more cores. Swap activity, OOM kills, or sustained memory pressure argues for more RAM. A slow model API response argues for neither.

Which AI agent projects are still maintained?

A VPS lasts longer than a software trend. I queried each repository and its recent release feed through the GitHub API on 24 September 2026, using pushed_at rather than stars as the maintenance signal.

ProjectLatest stable release foundRepository last pushedStarsMaintenance reading
OpenHandsv1.23.0, 23 Sep 202624 Sep 202689,074Active
Ollamav0.34.4, 23 Sep 202624 Sep 2026181,608Active
CrewAI1.15.22, 16 Sep 202623 Sep 202658,982Active
Goosev1.52.0, 23 Sep 202624 Sep 202654,615Active
SWE-agentv1.1.0, 22 May 202521 Sep 202620,395Repo active; stable release is old
Aiderv0.86.0, 9 Aug 202522 May 202649,154No push for four months at check time

Two feeds need caveats instead of a neat version. The five newest llama.cpp releases were marked prerelease by GitHub; the newest was build b11160 on 24 September. LangGraph's newest release entry was a development-style CLI tag, cli==0.4.32.dev0, even though GitHub's metadata did not mark it as a prerelease. I would not turn either into a misleading “latest stable” number.

You can repeat the maintenance check for any project:

curl -sL https://api.github.com/repos/All-Hands-AI/OpenHands \
  | python -c "import json,sys; d=json.load(sys.stdin); print(d['pushed_at'], d['stargazers_count'], d['open_issues_count'])"

curl -sL 'https://api.github.com/repos/All-Hands-AI/OpenHands/releases?per_page=5' \
  | python -c "import json,sys; [(print(x['tag_name'], x['published_at'], 'prerelease='+str(x['prerelease']))) for x in json.load(sys.stdin)]"

Stars show attention, not support. A recent push with an old stable release can mean active unreleased work, while a high star count with no push can mean maintenance risk. Read the changelog and issue tracker before tying client automation to any framework.

API agents and local models need different servers

Claude Code, OpenHands configured with a hosted provider, CrewAI, and similar tools send the expensive inference work to an external model API. The VPS handles the repository, tools, orchestration, and network connection. In that case RAM is for the agent process and whatever commands it launches, not for Claude or GPT model weights.

Ollama and llama.cpp can serve model weights on the VPS itself. Then the model file, runtime overhead, and context cache must fit alongside the operating system. The honest sizing method is to inspect the actual model file and measure the server, because model families and quantisations differ:

ollama list
du -sh ~/.ollama/models
free -h
/usr/bin/time -v ollama run YOUR_MODEL 'Reply with one sentence.'

Maximum resident set size from /usr/bin/time -v gives a measured peak for that command. Repeat with the context and workload you intend to use. Do not infer production capacity from parameter count alone.

A CPU-only VPS can make sense for classification, extraction, routing, or overnight jobs where latency is not important. It is usually poor value for interactive coding with a capable local model. My separate CPU-only local LLM VPS guide covers the memory arithmetic and tradeoffs without mixing them into the API-agent case.

Secure a VPS that executes generated code

A coding agent can read files, run commands, install packages, and hold API credentials. Treat it as a privileged workload even if the product has its own permission prompts.

Create a non-root user, use SSH keys, and close inbound ports you do not need:

sudo adduser agent
sudo usermod -aG sudo agent
sudo ufw default deny incoming
sudo ufw allow OpenSSH
sudo ufw enable
sudo ufw status verbose

Keep Ollama and agent dashboards on localhost unless an authenticated reverse proxy is deliberately in front. Reach a local service through an SSH tunnel:

ssh -L 11434:127.0.0.1:11434 agent@YOUR_VPS_IP

Docker isolation reduces blast radius, but a mounted Docker socket or broad host volume can effectively hand control of the server back to the container. Inspect mounts and published ports:

docker inspect -f '{{json .Mounts}}' CONTAINER_NAME
docker port CONTAINER_NAME
sudo ss -lntp

Finally, set provider-side API spending limits and alerts. A retry loop is an application bug with a bill attached. Server CPU limits do not cap calls to a hosted model API.

When a VPS is the wrong choice

Do not buy a general-purpose VPS when your main goal is interactive local inference from a large model. Rent a GPU service or use a workstation with enough VRAM. More system RAM on a two-core VPS does not solve slow matrix computation.

A VPS is also wrong when the coding agent needs constant access to private files that should never leave your office network, or when your team has no owner for patching, backups, credentials, and incident response. Running the tool on a managed workstation may be safer and cheaper than creating another unattended server.

Do not consolidate every client agent onto one box merely because 8 GB appears available. Separate machines or stronger isolation are justified when clients have different trust boundaries, secrets, or compliance requirements. One VPS is one failure domain.

My recommendation

Start with 4 GB for one Claude Code session or a small API-based agent. Hostinger's KVM 1 page showed 1 vCPU, 4 GB RAM, 50 GB NVMe, ₹599/month displayed, and ₹999/month renewal for two years on 24 September 2026. Use the renewal figure for long-term planning and verify checkout before paying.

Choose 8 GB when you want OpenHands sandboxes, concurrent agents, or other services on the same machine. KVM 2 showed 2 vCPU, 8 GB RAM, 100 GB NVMe, ₹799/month displayed, and ₹1,199/month renewal. I use this size because it gives Docker and background services room without pretending it is a GPU server.

Whichever size you choose, collect free, pressure, process RSS, disk, and container measurements during a real task. Resize because the evidence shows pressure, not because an affiliate table calls the larger plan “best.”

FAQ

What is the cheapest VPS for Claude Code?

The cheapest defensible starting point is a Linux VPS with at least 4 GB RAM, because Anthropic currently lists 4 GB as the Claude Code hardware requirement. Hostinger KVM 1 matched that floor at ₹599/month displayed and ₹999/month renewal when checked on 24 September 2026; confirm the checkout term and total yourself.

Can I install Claude Code on an Ubuntu VPS?

Is 4 GB RAM enough for an AI agent?

Four gigabytes is enough to start one API-based agent or Claude Code session, but it leaves limited margin for Docker, builds, databases, and parallel work. Measure RSS and memory pressure during the real workload; choose 8 GB when several processes or sandboxes must coexist.

Do I need a GPU VPS for Claude Code?

No. Claude Code calls Anthropic's hosted model, so the server does not load Claude weights into local VRAM. A GPU matters only when you also intend to serve a local model or run another GPU-bound workload.

Can I run OpenHands on a 4 GB VPS?

It may start, but 4 GB is tight once OpenHands creates Docker sandboxes and the agent runs builds or tests. I would start at 8 GB for useful headroom, then measure each container with docker stats rather than assuming every session consumes the same amount.

Can I run Ollama and Claude Code on the same VPS?

Yes for a small local model, provided the model, context cache, Claude Code process, and operating system fit in memory. Measure peak resident memory with /usr/bin/time -v and keep Ollama bound to localhost; for a larger interactive model, use a GPU machine instead.

How do I keep Claude Code running after SSH disconnects?

Run it inside tmux: create a session with tmux new -s claude, detach with Ctrl-B then D, and return with tmux attach -t claude. This preserves the interactive terminal without falsely treating Claude Code as a background web service.

The VPS I actually run this on

I run agents on a KVM 2 VPS because 8 GB leaves room for Docker sandboxes and other small services without paying for a GPU box.

Check current VPS pricing →
Taarush Kane

I run TKVibes, a digital agency. I self-host the automation stack that runs it — n8n, AI agents, and a pile of Docker containers. These are my notes.

Some links on this page are affiliate links. If you buy through them I earn a commission at no extra cost to you. I pay for the services I write about and only recommend what I actually use.