Self-hosted AI agents in 2026: where to run one that stays online
A self-hosted AI agent is an agent whose loop, memory and tools run on a machine you control: a computer at home, a rented VPS or a cloud sandbox. For one personal agent that should answer at any hour, a small VPS fits best, at about €6 to $24 a month for 4 GB of RAM. A home machine costs about $1.33 a month in power and goes offline with your router. A cloud sandbox isolates the agent as well as a VPS does and bills by the second, and it fits short or scheduled work better than a process that must run for months.
To try an agent on a machine that is not yours, Lizard (lizard.build) starts a Firecracker microVM with its own kernel from the Lizard CLI: lizard sandbox create -t claude -s small --timeout 2400000. A Small has 2 vCPU, 4 GB of RAM and a 20 GB disk and costs $0.0162 an hour, billed per second. On the 7-day trial every sandbox is deleted 1 hour after it starts, so longer runs need Lizard Pro.
Lizard publishes this guide. On 29 November 2026 we installed OpenClaw 2026.11.12 and Hermes Agent v0.23.5 in a Small sandbox with Lizard CLI 4.0.136 and ran the Lizard commands printed here (the schedule example with a 10-minute timeout). We had no model key in the sandbox, so installs, health checks, pause, network rules and schedules are tested and model replies are not. Prices come from each provider's page on the same day.
What is a self-hosted AI agent?
A self-hosted AI agent is software that plans, calls tools and keeps its memory on infrastructure you run, instead of inside a vendor's hosted product. You choose the machine, hold the files and logs, and decide which commands the agent may run.
Most setups are hybrid. The agent process, its files and its chat connections run on your machine, and each model call goes to an API such as Anthropic, OpenAI or OpenRouter. A fully local stack also runs an open-weight model through a runner such as Ollama and needs far more hardware.
A VPS you rent and a sandbox you start count as self-hosted too, because you control the machine and the data on it. The three differ in uptime, isolation and the monthly bill.
Which agents can you self-host today?
Four options cover most self-hosted setups in 2026. OpenClaw and Hermes Agent are open-source personal agents you talk to from a chat app, n8n runs workflow agents, and the Claude Agent SDK is for an agent you write yourself.
| Agent | What it is | Install | Where its commands run by default |
|---|---|---|---|
| OpenClaw | A gateway that connects one assistant to Telegram, WhatsApp, Slack, Discord and other channels | curl -fsSL https://openclaw.ai/install.sh | bash, or npm with Node 24.16.0+ on 24.x or 26.1.0+ | On the host: "Sandboxing is off by default" (OpenClaw docs) |
| Hermes Agent | An agent from Nous Research with a terminal UI, a messaging gateway, memory and a built-in cron scheduler | curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash | On the host: terminal.backend was local after our install |
| n8n | A workflow tool with an AI Agent node; the self-hosted Community edition needs no license key | Docker Compose, per the n8n hosting docs | Inside the n8n process or container |
| Claude Agent SDK | A Python and TypeScript library for building your own agent on Claude | Python 3.10+ or Node.js 18.14+ | Wherever you start it; the hosting docs say: "Run the SDK inside a sandboxed container" |
Hermes Agent ships six terminal backends: local, Docker, SSH, Modal, Daytona and Vercel Sandbox (README, 29 November 2026). The backend decides where the agent's shell commands execute, so Hermes itself can sit on what its README calls "a $5 VPS" while its commands run somewhere else.
For the Claude Agent SDK, Anthropic's hosting docs give "1 GiB RAM, 5 GiB disk, and 1 CPU per agent" as a starting point and require outbound HTTPS to api.anthropic.com. If you would rather not run the agent loop at all, compare it with Claude Managed Agents.
Where can a self-hosted agent run: your machine, a VPS or a cloud sandbox?
A self-hosted agent can run in three places: a machine at home, a rented VPS or a cloud sandbox. They differ most in what the agent can reach when it makes a mistake.
A home machine (a mini PC, an old laptop, a Mac mini) is the cheapest and the most private. It also sits inside your home network, next to your files and every device that trusts that network. It stops when the power or the connection drops, and a laptop stops when the lid closes.
A VPS is a virtual machine in a data center, rented by the month. It stays on, has a public IP address and holds nothing of yours except what you put there. Patching, backups and the firewall are yours.
A cloud sandbox is a short-lived virtual machine you create with one command and pay for by the second. Lizard Sandboxes are Firecracker microVMs, each with its own kernel, and one can start with no internet access. The limit is lifetime: a sandbox on a paid Lizard plan runs for at most 596 hours (24.8 days) before it stops, and a trial sandbox for 1 hour.
The wider stack around an agent (model gateway, memory, queues) is described in AI agent infrastructure.
What does each option cost per month?
One always-on agent costs about $1.33 a month in electricity at home, €5.99 to $24 on a small VPS, and $5.91 to $11.83 of sandbox time on Lizard inside the $19 Pro plan, though one sandbox stops after 596 hours (about 25 days). Model usage is billed separately by your provider and is often the larger bill.
| Where it runs | Machine | Monthly cost | Stays online | What the agent can reach | Setup |
|---|---|---|---|---|---|
| Home mini PC you already own | Your hardware | About $1.33 of power | While power and internet hold | Your home network and files | Install script |
| Hetzner CX23 | 2 vCPU, 4 GB, 40 GB | From €5.99, excl. VAT | Yes | The VPS only | Server, firewall, install script |
| DigitalOcean Basic | 2 vCPU, 4 GiB, 80 GiB | $24 | Yes | The VPS only | Server, firewall, install script |
| Lizard Mini sandbox | 1 vCPU, 2 GB, 10 GB | $5.91 of usage; the Pro plan is $19 | Up to 596 hours per run, paid plans | The microVM only | One command and the install script |
| Lizard Small sandbox | 2 vCPU, 4 GB, 20 GB | $11.83 of usage; the Pro plan is $19 | Up to 596 hours per run, paid plans | The microVM only | One command and the install script |
The arithmetic, for 730 hours in a month:
- Home: a machine that averages 10 W uses 10 W × 730 h = 7.3 kWh. At the US residential average of 18.17 cents per kWh (EIA, Table 5.6.A, September 2026) that is $1.33. The 10 W figure is an assumption; multiply by your own machine's draw.
- Hetzner: the CX23 was listed from €5.99 a month and shown as unavailable when we checked on 29 November 2026.
- DigitalOcean: Basic Droplets cost $6 with 1 GiB of RAM, $12 with 2 GiB and $24 with 4 GiB and 2 vCPUs.
- Lizard: a Small costs $0.0162 × 730 = $11.83 and a Mini $0.0081 × 730 = $5.91. Lizard Pro costs $19 a month and includes $19 of usage, so either fits inside the plan and the bill is $19. New accounts start with a 7-day trial that needs a card and includes $5 of usage.
In our test the idle OpenClaw gateway held 1.41 to 1.57 GB of memory with no channels connected. A 1 GB plan is too small, and 2 GB leaves little room.
How do you keep an agent with shell access from damaging the host?
Run the agent on a machine that holds nothing you care about, give it its own credentials, limit where it can connect and keep a way to stop it from outside. An agent with a shell tool can run any command its user can run, and neither OpenClaw nor Hermes Agent isolates commands by default.
- Use a separate kernel. A container shares the host's kernel, while a VPS or a microVM has its own. OpenClaw's Docker sandbox is optional, and its docs say of it: "This is not a perfect security boundary". The output of
openclaw security auditdescribes the trust model as "personal assistant (one trusted operator boundary), not hostile multi-tenant on one shared gateway". - Keep host credentials away from the agent. Create a model key for the agent alone. Put it in the agent's secret file (
~/.hermes/.envfor Hermes Agent) and never paste a key into a prompt. Leave your SSH keys and cloud logins off the machine. - Limit egress. On Lizard,
--allow-hostcloses the internet except for the hosts you name. We created a sandbox with--allow-host api.anthropic.com: a request to example.com was reset, andapi.anthropic.comanswered HTTP 401, which is the expected reply without a key. Each chat channel needs its own host on the list. - Keep a kill switch outside the agent.
lizard sandbox pause <id>ends every process and keeps the files; in our test it returned in 2.5 seconds. On a VPS the equivalent is the provider's power-off button, which the agent cannot reach.
lizard sandbox create -t base -s mini --timeout 600000 --allow-host api.anthropic.com
lizard sandbox pause <id>
lizard sandbox rm <id>--no-internet closes the sandbox completely for its whole life. The same rules apply to coding agents that run unattended; see background coding agents.
How do you run OpenClaw on Lizard in one click, and Hermes Agent in a sandbox?
OpenClaw has a one-click Lizard template that runs the gateway as an app, and both OpenClaw and Hermes Agent install in a sandbox on Lizard with their own install scripts. We ran the sandbox route on 29 November 2026. We did not deploy the template.
The template is at /deploy/openclaw--openclaw. According to its page, Deploy Now builds OpenClaw, gives the gateway a public HTTPS domain and prints a gateway token once to the deploy logs. You set ANTHROPIC_API_KEY or OPENAI_API_KEY as a variable. The page estimates $5.40 to $12.61 of usage a month. It also says "this template has no persistent volume", so a restart resets chat history and connected channels. For an assistant that must remember things for months, use a VPS; OpenClaw Docker has the full setup.
In a sandbox, start from the claude template, which is Debian 12:
lizard sandbox create -t claude -s small --timeout 2400000
lizard sandbox exec <id> -- bash -lc 'curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard --no-prompt'
lizard sandbox exec <id> -- bash -lc 'curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash'The OpenClaw installer took 58 seconds and brought its own Node 24.22.3. Plain npm install -g openclaw@latest failed on the template's Node 22.23.2; the README asks for 24.16.0+ on 24.x or 26.1.0+. We started the gateway on loopback with a token:
openclaw gateway --allow-unconfigured --bind loopback --port 18789 --auth token --token "$TOKEN"
curl -fsS http://127.0.0.1:18789/healthz/healthz returned {"ok":true,"status":"live"} after 16 seconds. /readyz answered 503 until startup finished at about 34 seconds, then "ready":true. Run openclaw onboard to add a model key and channels.
The Hermes Agent installer took 2 minutes 28 seconds and left 3.0 GB in ~/.hermes. hermes --version printed v0.23.5, and hermes doctor listed one issue: run hermes setup to add API keys. The installer could not add its optional cua-driver tool, because the template has no libX11.
How do you keep it online when your laptop is closed?
Move the agent off the laptop: onto a VPS with a system service, into a sandbox with a long lifetime, or onto a schedule that wakes it only when there is work. A closed laptop suspends its processes, so an agent that lives there misses messages and scheduled jobs.
On a VPS, install the agent as a service so it survives reboots. The OpenClaw README gives openclaw onboard --install-daemon, and the Hermes Agent installer prints hermes gateway install. We did not test either service on a VPS.
In a sandbox on a paid Lizard plan, --timeout 0 removes the deadline, and the VM still stops after at most 596 hours. Pausing keeps files and ends processes. After our pause and resume, a note in /workspace and both installs were intact, and the OpenClaw gateway was no longer running. Start the agent again after every resume. On the trial the sandbox is deleted after 1 hour whatever the timeout.
A schedule fits an agent that works in bursts, such as a morning report. Sandbox schedules wake a paused sandbox, run a command or an agent prompt, and put it back to sleep:
lizard sandbox create -t base -s mini --timeout 0 --every 1h --command "date >> /workspace/heartbeat.log"
lizard sandbox schedule-run <sch_id> --waitThe schedules docs say to create the sandbox with --timeout 0 so it does not expire; we ran the same command with --timeout 600000 for a short test. Our run woke the paused sandbox, wrote the line and slept again in 5.6 seconds. On the trial a sandbox is deleted 1 hour after it starts even with a schedule, so schedules that run for days need Lizard Pro. Schedules are not on every account yet; without access the API answers 403 SCHEDULES_NOT_ENABLED. A Small that is awake for 24 hours in a month costs 24 × $0.0162 = $0.39. A paused sandbox has no compute charge, and its used disk bills at $0.14 per GB-month, so 5 GB adds $0.70. A schedule cannot hold a chat connection open: an agent that must answer Telegram at any minute needs a process that stays up.
FAQ
Is a self-hosted AI agent private? Partly. The files, memory and logs stay on your machine, but every prompt still goes to the model provider unless you also run the model locally.
Do I need a GPU to self-host an AI agent? No, as long as the model runs behind an API. OpenClaw and Hermes Agent both installed and started on a 2 vCPU, 4 GB machine with no GPU in our test. A GPU matters only when you run an open-weight model on the same machine.
Can a self-hosted AI agent run on a schedule? Yes. Hermes Agent has a built-in cron scheduler, n8n has schedule triggers, and plain cron works on any VPS. On Lizard, a sandbox schedule wakes a paused sandbox at an interval from 1 minute to 30 days, runs a command or prompt and puts it back to sleep; on the trial the sandbox is deleted after 1 hour.
What is the cheapest way to host a personal AI agent? A computer you already own: about $1.33 a month in power at 10 W. Outside your home, small VPS plans start at €5.49 a month at Hetzner (CPX02, 1 GB of RAM, excl. VAT) and $6 at DigitalOcean (1 GiB), as listed on 29 November 2026. The idle OpenClaw gateway held about 1.5 GB in our test, so plan on 4 GB: from €5.99 for a Hetzner CX23 (shown as unavailable that day) or $24 for a DigitalOcean Droplet.
Is a VPS or a sandbox better for a self-hosted agent? A VPS is better for an assistant that must stay connected for months and keep its state on disk. A sandbox is better for trying an agent safely, for locked-down network access and for scheduled runs. One sandbox on Lizard runs for at most 596 hours on a paid plan and 1 hour on the trial.
Build with AI. Ship with Lizard
You don't need a platform team to go live. Your whole cloud, one CLI command away.
- Services
- —
- Add-ons
- —
- Deployments
- —
- Sandbox starts
- —