Clawdbot on GCP Compute Engine (Docker, Production VPS Guide)
Goal
Run a persistent Clawdbot Gateway on a GCP Compute Engine VM using Docker, with durable state, baked-in binaries, and safe restart behavior. If you want “Clawdbot 24/7 for ~$5-12/mo”, this is a reliable setup on Google Cloud. Pricing varies by machine type and region; pick the smallest VM that fits your workload and scale up if you hit OOMs.What are we doing (simple terms)?
- Create a GCP project and enable billing
- Create a Compute Engine VM
- 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
Quick path (experienced operators)
- Create GCP project + enable Compute Engine API
- Create Compute Engine VM (e2-small, Debian 12, 20GB)
- SSH into the VM
- Install Docker
- Clone Clawdbot repository
- Create persistent host directories
- Configure
.envanddocker-compose.yml - Bake required binaries, build, and launch
What you need
- GCP account (free tier eligible for e2-micro)
- gcloud CLI installed (or use Cloud Console)
- SSH access from your laptop
- Basic comfort with SSH + copy/paste
- ~20-30 minutes
- Docker and Docker Compose
- Model auth credentials
- Optional provider credentials
- WhatsApp QR
- Telegram bot token
- Gmail OAuth
1) Install gcloud CLI (or use Console)
Option A: gcloud CLI (recommended for automation) Install from https://cloud.google.com/sdk/docs/install Initialize and authenticate:2) Create a GCP project
CLI:- Go to IAM & Admin > Create Project
- Name it and create
- Enable billing for the project
- Navigate to APIs & Services > Enable APIs > search “Compute Engine API” > Enable
3) Create the VM
Machine types:| Type | Specs | Cost | Notes |
|---|---|---|---|
| e2-small | 2 vCPU, 2GB RAM | ~$12/mo | Recommended |
| e2-micro | 2 vCPU (shared), 1GB RAM | Free tier eligible | May OOM under load |
- Go to Compute Engine > VM instances > Create instance
- Name:
clawdbot-gateway - Region:
us-central1, Zone:us-central1-a - Machine type:
e2-small - Boot disk: Debian 12, 20GB
- Create
4) SSH into the VM
CLI:5) Install Docker (on the VM)
6) Clone the Clawdbot repository
7) Create persistent host directories
Docker containers are ephemeral. All long-lived state must live on the host.8) Configure environment variables
Create.env in the repository root.
9) Docker Compose configuration
Create or updatedocker-compose.yml.
10) 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
11) Build and launch
12) Verify Gateway
13) Access from your laptop
Create an SSH tunnel to forward the Gateway port: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 |
Updates
To update Clawdbot on the VM:Troubleshooting
SSH connection refused SSH key propagation can take 1-2 minutes after VM creation. Wait and retry. OS Login issues Check your OS Login profile:Service accounts (security best practice)
For personal use, your default user account works fine. For automation or CI/CD pipelines, create a dedicated service account with minimal permissions:-
Create a service account:
-
Grant Compute Instance Admin role (or narrower custom role):
Next steps
- Set up messaging channels: Channels
- Pair local devices as nodes: Nodes
- Configure the Gateway: Gateway configuration