Install OpenClaw with Docker
Minimal steps + common fixes.
Prereqs
- Docker + Docker Compose
- A machine that can stay online (optional)
Quick Start (5 min)
# 1) Clone OpenClaw
git clone https://github.com/openclaw/openclaw.git
cd openclaw
# 2) Generate auth token (one-time)
openclaw token new
# 3) Start with Docker Compose
docker compose up -d
# 4) Verify
docker ps # should see openclaw container
openclaw statusWhat Happens
- Gateway starts on
localhost:8000(internal API) - CLI connects automatically (uses auth token)
- Agent runtime is ready for multi-channel routing (Telegram, Discord, WhatsApp, etc.)
Configuration (Optional)
Edit openclaw.json to customize:
{
"gateway": {
"bind": "0.0.0.0:8000", // publicly accessible
"token": "auto", // regenerated on start
"logLevel": "info"
},
"channels": {
"telegram": { "botToken": "YOUR_BOT_TOKEN" },
"discord": { "token": "YOUR_DISCORD_TOKEN" },
"whatsapp": { "token": "YOUR_WHATSAPP_TOKEN" }
// add more as needed
}
}Next Steps
- Connect a channel: Add credentials to
openclaw.json - Write an agent: See official docs for agent SDK & examples
- Deploy to VPS: Use same compose file on any Linux server
Troubleshooting
❌ Port 8000 already in use
docker compose -f docker-compose.yml up -d -e GATEWAY_PORT=9000Or edit docker-compose.yml → ports section
❌ Permission denied (docker: cannot connect to daemon)
sudo usermod -aG docker $USER
# then logout + login❌ Container exits immediately
docker compose logs openclaw # check errorCommon: missing env vars in openclaw.json
❌ Can't reach from outside machine
Check: firewall rules, VPS security group, or NAT. Gateway must bind to 0.0.0.0 not 127.0.0.1
Need the fastest answer?