What an AI agent actually needs from a server
Start with the split that decides everything else. There are two kinds of agent workloads, and they need wildly different hardware:
- API-orchestrator agents. Claude Code, Codex, Hermes, OpenClaw, and most agent frameworks. The model runs in Anthropic's or OpenAI's datacenter. Your server runs a loop: send context, receive a tool call, execute it, repeat. That loop is cheap. 1 vCPU and 1-2GB of RAM covers the agent process itself.
- Local-model agents. You run the weights on your own hardware with Ollama or similar. Now RAM is the whole game. A quantized 8B model wants 8GB+ just for weights and context. A 70B model wants 48GB+ and serious cores, and CPU inference is still slow. GPU boxes that do this well run $200-500/month.
Almost everyone reading this is in the first group, and the practical spec for the first group is a step above the theoretical minimum. Budget for what the agent does, not what it is:
- Terminal-only agent, external API: 1 vCPU, 2GB RAM, 20GB disk. Works, but swapping starts fast if anything else runs.
- Comfortable single agent: 2 vCPU, 4GB RAM, 40GB SSD. Room for Docker, a gateway process, and log growth. This is the spec to actually buy.
- Agent + browser automation: 4GB minimum, 8GB comfortable. A headless Chrome instance is heavier than the agent driving it, and an uncapped Chrome will eat every gigabyte you give it.
- Local models: 8GB+ for small models, and be honest with yourself about token speed before committing.
Disk fills slower than you fear but faster than zero. Session databases, JSONL logs, and files the agent downloads all accumulate. 40GB buys years for a single agent. 20GB buys months if browser downloads are involved.
Provider comparison: Hetzner, DigitalOcean, Vultr, Linode
For the 2 vCPU / 4GB class that most agents want, here is where the market sits in mid 2026:
| Provider | Plan | vCPU | RAM | SSD | Price/mo |
|---|---|---|---|---|---|
| Hetzner | CX23 | 2 | 4 GB | 40 GB | ~$4.50 |
| Hetzner | CX33 | 4 | 8 GB | 80 GB | ~$7.30 |
| Vultr | Regular Cloud | 2 | 4 GB | 80 GB | $20 |
| Linode | Shared 4GB | 2 | 4 GB | 80 GB | $24 |
| DigitalOcean | Basic | 2 | 4 GB | 80 GB | $24 |
Prices move, so verify before you buy. The shape of the table does not move: Hetzner is roughly a quarter of the price of the US-brand trio for equivalent agent workloads.
What the price gap does and does not buy:
- Hetzner is the community default for agent hosting for a reason. The catch list is short but real: EU datacenters plus two US locations, a stricter signup verification process, and a support culture that assumes you know Linux.
- DigitalOcean has the best documentation and tutorials in the business. If this is your first server, that is worth something. It is not worth 5x forever.
- Vultr has the widest location spread, useful if you need the box near a specific region. Pricing is otherwise DigitalOcean-shaped.
- Linode (Akamai) is solid and boring in the good sense. Long-running boxes, predictable network. Same pricing problem as the other US brands.
For a personal agent where a few hours of downtime is annoying rather than fatal, take the Hetzner CX23 or CX33 and spend the savings on your API budget. To compare the full monthly picture including API costs, run your numbers through the AI agent hosting cost calculator.
Security: the section the listicles skip
An agent VPS is not a normal VPS. A normal server holds your app. An agent server holds credentials that act as you: API keys, OAuth sessions, shell access, sometimes a logged-in browser. Treat it like a machine that can spend your money, because it is one.
Rule 1: no public ports beyond SSH. The agent's web UI, gateway, and any dashboard should listen on localhost only. Do not bind them to 0.0.0.0 and rely on an obscure port number. Internet-wide scanners find every open port on every IPv4 address in hours, not weeks.
Rule 2: reach the box over a private network, not the open internet. Tailscale is the easy version: install it on the VPS and your laptop, and the agent UI is reachable at a private 100.x address that only your devices can see.
An SSH tunnel (ssh -L 8080:localhost:8080 user@vps) does the same job with zero new software if you only ever connect from one machine.
Rule 3: API-key hygiene. Keys live in the environment or a root-owned env file with chmod 600, never in the agent's working directory where a tool call can read or commit them. Use a separate key per box so you can revoke one machine without rotating everything. Set spend limits on the provider side; a runaway loop should hit a $25 cap, not your card limit.
Rule 4: know the OAuth-on-a-VPS ToS trap. Claude Code and Codex both support signing in with your consumer subscription instead of an API key. Those subscriptions are personal logins, and putting a personal OAuth session on shared or third-party-managed infrastructure can sit badly with provider terms, which generally prohibit sharing account access. A VPS that only you control and only you access is the defensible setup: one person, one login, one machine. What you should not do is park a shared team login on a box five people SSH into. If the account matters to you, read the current terms yourself before deciding.
Rule 5: contain the agent itself. The agent executes code and shell commands as part of normal operation. Run it as a non-root user, and prefer the Docker install where the agent offers one, so a bad tool call trashes a container instead of the host. This is also the honest argument for one-agent-per-box: isolation by hardware boundary beats isolation by hope.
Setup checklist: from fresh box to durable agent
The order matters. Harden first, install second.
Then make the agent survive reboots. A tmux session dies with the machine; a systemd unit comes back on its own:
Finally, backups. The irreplaceable part of an agent box is small: config, memory files, session database. A nightly restic or rsync job to storage that lives somewhere else takes ten minutes to set up. The VPS provider's disk is not a backup; a deleted server takes its disk with it.
Per-agent notes: Claude Code, Codex, Hermes, OpenClaw
Claude Code installs with npm install -g @anthropic-ai/claude-code after Node.js. It is interactive, so on a raw VPS you run it inside tmux and reattach over SSH. The headless mode (claude -p "...") suits cron-driven jobs. 2GB RAM is fine for the CLI alone; add headroom if the agent will drive a browser. Details on the Claude Code agent page.
Codex follows the same shape: Node.js, npm install -g @openai/codex, sign in with your ChatGPT login, run in tmux. Same specs, same caveats. See the Codex agent page.
Hermes is a full agent platform rather than a coding CLI: gateway, memory system, Telegram and Discord connections, scheduled tasks. It wants the 2 vCPU / 4GB spec as a working minimum and 40GB of disk for state growth. The self-hosting guide covers the install end to end, and the VPS comparison for Hermes goes deep on provider specifics.
OpenClaw runs as a long-lived gateway process, and its default posture assumes a trusted network. That makes the no-public-ports rule non-negotiable: loopback binding plus Tailscale, exactly as above. The OpenClaw self-hosting walkthrough covers it step by step. Browser automation is core to OpenClaw workflows, so budget 8GB RAM, not 4GB.
All four, plus Aeon and Agent Zero, are also launchable as managed boxes; the full lineup is on the agents page.
When managed beats a raw VPS
The DIY route above is real and it works. Priced honestly, it is $5-10/month in server rent, 1-3 hours of setup, and a slow drip of maintenance: OS patches, agent updates, disk cleanup, and the occasional evening lost to a gateway that stopped restarting. If you enjoy that work, nothing here needs improving. (And if you are still deciding whether a VPS is even the right shape, the AI agent hosting guide compares all four options: own hardware, VPS, serverless, and managed.)
Hivra is the version where the checklist above is someone else's job. Each agent runs on its own private VM, provisioned in about 5 minutes, with the official unmodified CLI. Claude Code uses your own Anthropic login and Codex uses your own ChatGPT login, so there is zero markup on AI usage. You get a browser view of the running session instead of a bare SSH terminal.
The plan math, plainly: the free tier runs 1 agent and sleeps after 4 idle days, with no browser automation. Pro at $9.99/month runs 3 agents always-on. Power at $19.99/month runs 5. Hermes, Claude Code, Codex, and Aeon launch on the free tier; OpenClaw and Agent Zero need Pro. Full details on the pricing page.
A reasonable decision rule: if you were going to buy one Hetzner box for one agent and follow this guide carefully, the DIY route saves a few dollars and teaches you things. If you want two or three agents, want them reachable from your phone, or do not want to own the security section personally, managed is cheaper than your time. If you are not sure your usage justifies always-on hosting at all, the agent survival check is a two-minute sanity test.