Run AI Coding Agents on a VPS: 24/7 Multi-Agent Fleet
In June 2026, developer BennyKok shared a workflow that got significant attention: he moved his AI coding agents (Claude Code, Codex CLI, etc.) off his MacBook and onto a VPS. Using his open-source tool lfg, he runs multiple agents in parallel, manages them via voice and phone PWA, and hasn't touched his local machine for coding in a month.
Why Run AI Agents on a VPS Instead of Your Laptop
Most developers currently run a single AI agent in a terminal on their laptop. It works for one-off tasks but hits clear limits:
| Limitation | Local Laptop | VPS |
|---|---|---|
| Uptime | Stops when you sleep, close the lid, or shut down | 24/7 persistent execution |
| Parallel agents | 5 agents cause noticeable CPU/memory/heat pressure | Mid-range VPS handles 5-10 agents easily |
| Remote access | Lose connection when you walk away | Phone PWA + voice control from anywhere |
| Scaling cost | Hardware upgrade: thousands of dollars | €6-20/month, scale on demand |
BennyKok's post included a prediction: most developers will migrate their coding agents from laptops to the cloud within 6 months. Regardless of the exact timeline, one thing is already true: a VPS is the default infrastructure for running AI agents productively, not an optional add-on.
Updated Sep 16, 2026
OpenAI put the Agents API into public beta on 10 September 2026 — same day as the community announcement. OpenAI hosts the Codex harness (sessions, orchestration, compaction, recovery). You pick where the agent runs code: an OpenAI-hosted sandbox, a partner sandbox, or a machine you already rent.
Official partners include Cloudflare, DigitalOcean, Vercel, E2B, Modal, plus Blaxel, Daytona, Oracle, and Runloop. There is no extra fee for the harness. You pay tokens, tools, and sandbox/container rates. OpenAI-hosted sandboxes use their standard container prices.
That is a different loop from this page. Here you still run Claude Code / Codex CLI yourself (lfg + tmux). The Agents API is a managed harness with an optional sandbox attached.
| Split | Partner / OpenAI sandbox | Your VPS |
|---|---|---|
| Fits | Bounded session: spin up, finish, tear down | 24/7 fleet, long-running tmux, lfg on the phone |
| Network | Some partners offer VPC placement | Tailscale / WireGuard you control |
| Bill | Tokens + tools + container/sandbox hours | Tokens + a €6–20/mo box you leave on |
Partner sandbox is enough when the job has a clear start and stop — prototype a Codex-style session, isolate a workspace, let the vendor handle cold starts. You do not need a 24/7 VPS for that.
A VPS still wins for long-running loops, a private network into your repos, and cost control. Sandbox minutes are easy to leave running; a monthly VPS bill is the cap you already understand. Partner VPC is not the same as SSH onto a box you already pay for.
A managed sandbox is an execution environment for an Agents API session. It is not a substitute for the always-on fleet below.
lfg: One Tool to Manage All Your Agents
lfg is the open-source tool BennyKok built for this workflow. At its core: tmux sessions per agent + Web UI dashboard + Tailscale secure remote access.
What it does:
- View and control multiple AI agents (Claude Code, Codex CLI, etc.) from a single Web dashboard
- Agents share context and can be aware of each other's work
- Manage everything from a phone PWA with voice input support
- Each agent runs in its own isolated tmux session
Recommended VPS Specs for an Agent Fleet
| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 4 vCPU | 6-8 vCPU |
| RAM | 8 GB | 16 GB+ |
| Storage | 40 GB SSD | 80 GB+ NVMe SSD |
| OS | Ubuntu 22.04 / 24.04 or Debian 12 | |
| Network | Stable bandwidth + Tailscale/WireGuard | |
Each agent session consumes roughly 1-2 GB RAM, plus the Web UI and system overhead. A 4 vCPU + 8 GB instance runs 3-5 lightweight agents comfortably. For heavy workloads (large codebases, long-running tasks), move to 8 vCPU + 16 GB.
Top 5 VPS Providers for AI Coding Agents
| # | Provider | Recommended Config | Price | Best For |
|---|---|---|---|---|
| 1 | Hetzner | CX33 / CPX32 (4-8 vCPU, 8-16 GB) | €6.5-15/mo | Top choice for most developers |
| 2 | Contabo | Cloud VPS 20/30 (6-8 vCPU, 12-24 GB) | €6-12/mo | Budget-conscious, high-RAM needs |
| 3 | DigitalOcean | Basic / Premium Droplet (4-8 vCPU) | $12-24/mo | Beginners, low-maintenance |
| 4 | Vultr | High Frequency (4-8 vCPU) | $10-20/mo | Specific regional deployments |
| 5 | OVHcloud | Mid-tier VPS plan | €10-18/mo | EU users, privacy requirements |
Prices are June 2026 references. Check provider websites for current pricing. Hetzner and Contabo are the two most discussed providers in the AI agent community.
Hetzner (#1)
This is what BennyKok uses. Start with CX33 (4 vCPU / 8 GB / 80 GB / €6.5). For more agents, CPX32 (8 vCPU / 16 GB / 160 GB / €15). Hetzner's CPU performance consistency is notably better than competitors at this price point according to community feedback.
Contabo (#2)
Best RAM and storage per euro in this list. Cloud VPS 20 (6 vCPU / 12 GB / 240 GB / €6) and Cloud VPS 30 (8 vCPU / 24 GB / 360 GB / €12) are ideal for running many agents in parallel. Note that CPU performance may fluctuate during peak hours.
DigitalOcean (#3)
Most beginner-friendly. Clean control panel, excellent documentation, mature API. Costs more than Hetzner/Contabo, but the time saved on server management can justify the premium if you are new to Linux administration.
Deploy lfg on Your VPS (5-10 Minutes)
- Provision a VPS from the list above (Ubuntu 22.04/24.04)
- SSH in and run the official setup script:
curl -fsSL https://raw.githubusercontent.com/BennyKok/lfg/main/scripts/setup.sh | bash - Edit
.envand add your Claude or OpenAI API key - Install Tailscale for secure networking:
curl -fsSL https://tailscale.com/install.sh | sh - Start lfg and access the Web UI at your Tailscale IP on port 8766
- Create agents in the Web UI and assign tasks. Works from your phone too.
Costs and Considerations
- VPS monthly cost: €5-20 (~$5.50-22), depending on whether you pick Hetzner CX33 or Contabo Cloud VPS 30.
- API token cost: Separate from VPS fees. Claude Code / Codex billing varies significantly. Set per-agent usage caps in lfg to control spend.
- Monitoring: Install a lightweight monitor on the VPS. An API token bill spike is more expensive than a VPS bill spike.
- Backups: Push code repos to GitHub regularly. Do not treat the VPS as your only code storage.
FAQ
Does an Agents API sandbox replace a VPS?
No. A partner or OpenAI-hosted sandbox is enough for bounded Codex-harness sessions. Keep a VPS for 24/7 fleets, Tailscale/VPC, and a predictable monthly cap. See the 16 September 2026 note above.
If I self-host the sandbox on my VPS, is Agents API ZDR-eligible?
No. In this public beta the Agents API is US residency only and does not support Zero Data Retention. OpenAI says a self-hosted sandbox does not make the API ZDR-eligible — session state still lives on their side.
How many agents can a small VPS run?
4 vCPU + 8 GB can run 3-5 lightweight agents. For complex projects with large codebases or long-running tasks, 8 vCPU + 16 GB+ is recommended.
VPS vs. running locally on a MacBook?
VPS wins on 24/7 uptime, multi-agent parallelism, and remote management from a phone. Local is better for one-off debugging or latency-sensitive work. They are complementary: develop locally, run background agent tasks on VPS.
How much do API tokens cost?
Token costs are separate from VPS fees and billed by Claude/OpenAI directly. Usage varies significantly by project complexity. Set per-agent usage caps in lfg to avoid surprises.
Do I need a GPU VPS?
Currently no. API-driven CLI agents (Claude Code, Codex CLI) only need CPU. If the trend shifts toward self-hosting open-source models (DeepSeek, Qwen, etc.) at scale, GPU instances may become relevant.
Security considerations?
Use Tailscale or WireGuard. Do not expose port 8766 to the public internet. lfg binds to localhost by default. Create a dedicated non-root user to run agents for permission isolation.
Hetzner vs. Contabo?
Prioritize long-term stability and community support → Hetzner. Maximize RAM/storage per dollar → Contabo. Both are heavily discussed in the AI agent community. Test with one month before committing annually.