Clawdbot on Hetzner (Docker, Production VPS Guide)
Goal
Run a persistent Clawdbot Gateway on a Hetzner VPS using Docker, with durable state, baked-in binaries, and safe restart behavior. If you want “Clawdbot 24/7 for ~$5”, this is the simplest reliable setup. Hetzner pricing changes; pick the smallest Debian/Ubuntu VPS and scale up if you hit OOMs.What are we doing (simple terms)?
- Rent a small Linux server (Hetzner VPS)
- Install Docker (isolated app runtime)
- Start the Clawdbot Gateway in Docker
- Persist
~/.clawdbot+~/clawdon the host (survives restarts/rebuilds) - Access the Control UI from your laptop via an SSH tunnel
- SSH port forwarding from your laptop
- Direct port exposure if you manage firewalling and tokens yourself
If you are on another Linux VPS, map packages accordingly. For the generic Docker flow, see Docker.
Quick path (experienced operators)
- Provision Hetzner VPS
- Install Docker
- Clone Clawdbot repository
- Create persistent host directories
- Configure
.envanddocker-compose.yml - Bake required binaries into the image
docker compose up -d- Verify persistence and Gateway access
What you need
- Hetzner VPS with root access
- SSH access from your laptop
- Basic comfort with SSH + copy/paste
- ~20 minutes
- Docker and Docker Compose
- Model auth credentials
- Optional provider credentials
- WhatsApp QR
- Telegram bot token
- Gmail OAuth
1) Provision the VPS
Create an Ubuntu or Debian VPS in Hetzner. Connect as root:2) Install Docker (on the VPS)
3) Clone the Clawdbot repository
4) Create persistent host directories
Docker containers are ephemeral. All long-lived state must live on the host.5) Configure environment variables
Create.env in the repository root.
6) Docker Compose configuration
Create or updatedocker-compose.yml.
7) Bake required binaries into the image (critical)
Installing binaries inside a running container is a trap. Anything installed at runtime will be lost on restart. All external binaries required by skills must be installed at image build time. The examples below show three common binaries only:gogfor Gmail accessgoplacesfor Google Placeswaclifor WhatsApp
- Update the Dockerfile
- Rebuild the image
- Restart the containers
8) Build and launch
9) Verify Gateway
http://127.0.0.1:18789/
Paste your gateway token.
What persists where (source of truth)
Clawdbot runs in Docker, but Docker is not the source of truth. All long-lived state must survive restarts, rebuilds, and reboots.| Component | Location | Persistence mechanism | Notes |
|---|---|---|---|
| Gateway config | /home/node/.clawdbot/ | Host volume mount | Includes clawdbot.json, tokens |
| Model auth profiles | /home/node/.clawdbot/ | Host volume mount | OAuth tokens, API keys |
| Skill configs | /home/node/.clawdbot/skills/ | Host volume mount | Skill-level state |
| Agent workspace | /home/node/clawd/ | Host volume mount | Code and agent artifacts |
| WhatsApp session | /home/node/.clawdbot/ | Host volume mount | Preserves QR login |
| Gmail keyring | /home/node/.clawdbot/ | Host volume + password | Requires GOG_KEYRING_PASSWORD |
| External binaries | /usr/local/bin/ | Docker image | Must be baked at build time |
| Node runtime | Container filesystem | Docker image | Rebuilt every image build |
| OS packages | Container filesystem | Docker image | Do not install at runtime |
| Docker container | Ephemeral | Restartable | Safe to destroy |