页面更新 · 2026-09-16

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:

LimitationLocal LaptopVPS
UptimeStops when you sleep, close the lid, or shut down24/7 persistent execution
Parallel agents5 agents cause noticeable CPU/memory/heat pressureMid-range VPS handles 5-10 agents easily
Remote accessLose connection when you walk awayPhone PWA + voice control from anywhere
Scaling costHardware 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.

SplitPartner / OpenAI sandboxYour VPS
FitsBounded session: spin up, finish, tear down24/7 fleet, long-running tmux, lfg on the phone
NetworkSome partners offer VPC placementTailscale / WireGuard you control
BillTokens + tools + container/sandbox hoursTokens + 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.

Beta caveat: Agents API data residency is United States only. Zero Data Retention (ZDR) is not supported. Putting the sandbox on your own VPS does not make the API ZDR-eligible — session state still lives on OpenAI. If that is a hard requirement, do not route the agent loop through this API.

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:

Recommended VPS Specs for an Agent Fleet

ResourceMinimumRecommended
CPU4 vCPU6-8 vCPU
RAM8 GB16 GB+
Storage40 GB SSD80 GB+ NVMe SSD
OSUbuntu 22.04 / 24.04 or Debian 12
NetworkStable 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

#ProviderRecommended ConfigPriceBest 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)

  1. Provision a VPS from the list above (Ubuntu 22.04/24.04)
  2. SSH in and run the official setup script:
curl -fsSL https://raw.githubusercontent.com/BennyKok/lfg/main/scripts/setup.sh | bash
  1. Edit .env and add your Claude or OpenAI API key
  2. Install Tailscale for secure networking:
curl -fsSL https://tailscale.com/install.sh | sh
  1. Start lfg and access the Web UI at your Tailscale IP on port 8766
  2. Create agents in the Web UI and assign tasks. Works from your phone too.
Security: Do not expose port 8766 publicly. lfg binds to localhost by default. All external access goes through Tailscale's private IP. Run agents under a dedicated non-root user for permission isolation.

Costs and Considerations

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.

Related Reading