Running AI Coding Agents on a Remote Hetzner Box via Tailscale

Running an AI coding agent on your own hardware sounds simple until you realize your laptop is not a server. You want the raw compute of a Hetzner box, but your Claude Code or Cursor license is tied to your local machine. Tailscale solves the network problem, but the setup still requires juggling SSH keys, reverse tunnels, and environment variables. That friction is the problem nobody talks about when they sell you on remote development.

I hit this wall last month. I wanted to run a long refactoring pass through Claude Code on a Hetzner CX41 with 80GB of RAM, but every attempt to tunnel the session back to my Mac broke the context window or dropped the connection mid-stream. The tools exist, but they do not talk to each other. You end up writing shell scripts that patch together Tailscale, SSH, and a tmux session, and after an hour of configuration you are not building software anymore, you are maintaining infrastructure.

Existing Solutions

Most approaches to remote AI coding fall into two camps. The first is cloud-hosted IDEs like Gitpod or GitHub Codespaces, which charge per hour and lock you into their container images. You get a prebuilt environment, but you pay for every minute the container runs, and customizing the toolchain means writing a Dockerfile that nobody else has tested. The second is raw SSH into a VPS, where you manually install language runtimes, configure API keys, and pray your connection stays stable through a long coding session. Neither gives you a single command that just works.

pocketdev by 0xMassi tries to collapse that gap. The project is small, barely a thousand stars, but the idea is right. One command deploys a Tailscale-only Hetzner instance and wires up Claude Code, Codex, Cursor, Gemini, Grok, or aider so they all connect through the same overlay network. No public IP, no open ports, no reverse proxy configuration. The agent runs on your hardware, your API keys stay local, and you access it from any device through the Tailscale mesh. It is not a product with a dashboard and a pricing page. It is a script that does one thing well, and that is what makes it appealing.

The tradeoff is obvious. You are dependent on Tailscale’s reliability and Hetzner’s uptime. If the overlay network hiccups, your session disappears. There is no managed service backing you, no SLA, no support ticket to file. For a hobbyist or a solo developer, that is fine. For a team that needs guaranteed availability, this is a proof of concept, not a production platform.

Future with AI

The real promise is not the one-liner deploy. It is what happens when AI coding agents run on cheap, persistent hardware that never sleeps. You leave a session running overnight, the agent refactors a module, and you pull the results the next morning on your phone through Tailscale. The cost is a few euros a month for a Hetzner box, not the per-hour billing that cloud IDEs charge. Over weeks and months, that difference adds up.

As these tools mature, the boundary between local and remote blurs entirely. The agent does not care where it runs, only that it has context and compute. The future is not a better laptop, it is a better connection to a machine that does the work for you. Projects like pocketdev point toward that direction, even if the implementation is rough around the edges today.

Press Cmd K to search