GuidesHosting choices

Running Claude Code on an always-on VPS: the tmux pattern, done right

The persistent coding-agent box developers keep rebuilding: tmux for sessions that survive, a handover CLAUDE.md, and the security posture that makes it sane.

August 1, 2026The Everpod team
The short answer

The pattern developers keep rebuilding: a small VPS, Claude Code (or Codex) running inside tmux, and SSH from anywhere — laptop or phone. Detach, and the agent keeps working; reattach from any device and the session is exactly where you left it. It works well, and the setup is genuinely simple. The part that deserves your attention isn’t tmux — it’s the security posture of a box where an agent runs with relaxed permissions.

Why people want this

A coding agent on your laptop dies when the lid closes. Put it on an always-on machine instead and you get the things a laptop can’t give: multi-hour tasks that actually finish, kicking off work from your phone on the train, and one persistent environment that accumulates context instead of starting cold. The DIY walkthroughs for exactly this setup have been circulating among developers all year — it’s the same conclusion the agent world keeps reaching from every direction: agents want their own always-on computer.

The core pattern (twenty minutes)

For unattended scripted runs (cron jobs, CI-style tasks) the official non-interactive mode is claude -p with --allowedTools or a permission mode, and --continue/--resume to keep a thread going across invocations — that half is well documented; the persistent interactive box above is the half the docs don’t really cover.

The security posture is the whole game

On a remote box, the temptation is to run the agent with permissions wide open so it never stalls waiting for you. Understand what that trade means: an agent with unattended shell access is only as safe as everything it reads (a hostile string in a webpage or dependency README is an instruction-injection attempt against it), so the machine itself must be the boundary. Concretely: this box holds only what the agent needs — no password managers, no personal browser profiles, no do-everything cloud keys; repo access via a scoped deploy key, not your identity; a spending cap on the model account; and snapshots/backups so a bad afternoon is recoverable. A first-class citizen of this setup is the assumption that the agent will eventually do something you didn’t intend — arrange the blast radius accordingly.

Can the agent administer its own server?

Mostly, yes — and it’s genuinely useful. Package updates, service restarts, disk cleanups, “why is the dev server down” triage: agents handle this well when the handover file tells them the house rules. Two boundaries have earned their keep in our own operations: the agent administers inside the machine, but identity and access — SSH keys, firewall rules, the provider account — stay yours; and anything irreversible (destroying data, rotating keys, touching DNS) is an ask-first item written explicitly into the handover file. An agent that can rebuild its own dev environment is a feature; an agent that can lock you out of the box is a story you tell at parties.

DIY vs the hosted alternatives

First-party clouds now cover slices of this — Codex’s cloud tasks, Claude Code on the web — and they’re the zero-setup answer for bursty, repo-scoped work. What they don’t give you is the thing the VPS pattern exists for: a persistent machine you own, with state, tools, and context that accumulate. That’s the same ownership trade-off that runs through the whole open-agent world, and it’s why we expect the persistent-agent-computer shape to keep winning for daily-driver use. (Full disclosure of where we sit: Everpod hosts OpenClaw pods today — personal agents, not coding harnesses — so this guide is a straight do-it-yourself recipe. The security posture above is the same one we apply to the agent machines we do operate.)

Don’t want to run it yourself?

Everpod hosts OpenClaw for you: a secure, private, always-on cloud computer of your agent’s own — set up, secured, and backed up, with its software kept up to date and $10 of model usage included every month. Nothing to configure, no surprise bills — just say hello.

Request early access
$29/mo · $10 model usage included · cancel anytime