OpenClaw Docker Compose Guide
A practical setup for VPS and local servers with clean env management and fast recovery.
When to use this deployment
- You want stable 24/7 operation on a VPS
- You need reproducible setup for multiple environments
- You prefer easy rollback and versioned configuration
1) Create project directory
mkdir -p ~/openclaw && cd ~/openclaw2) Prepare .env file
Keep secrets out of compose.yml and store them in .env.
OPENCLAW_MODEL_PROVIDER=openai
OPENCLAW_MODEL=gpt-5.3-codex
OPENCLAW_API_KEY=your_api_key_here
OPENCLAW_TIMEZONE=Asia/Shanghai
OPENCLAW_WEB_PORT=30003) Minimal docker-compose.yml
services:
openclaw:
image: ghcr.io/openclaw/openclaw:latest
container_name: openclaw
restart: unless-stopped
env_file:
- .env
ports:
- "3000:3000"
volumes:
- ./data:/app/data
- ./logs:/app/logs
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 30s
timeout: 5s
retries: 54) Start and verify
docker compose pull
docker compose up -d
docker compose ps
docker compose logs -f --tail=200If the Web UI is not reachable, first check VPS firewall/security group for TCP 3000.
5) Daily operations
- Update image:
docker compose pull && docker compose up -d - Backup: snapshot
./dataand.env - Rollback: pin image tag instead of latest
SEO note for this tutorial page
This page targets query intent around "openclaw docker compose","openclaw vps deployment", and related setup phrases.
Quick Checklist
Compose file created and validated
Environment variables isolated in .env
Health check and logs verified after startup
Related Tutorials
Local Deployment Guide
Step-by-step guide to deploy OpenClaw on Mac, Linux, or Windows. Covers installation, model configuration, WhatsApp integration, and essential commands.
OpenClaw Gateway Setup
Set up OpenClaw gateway safely with env variables, startup checks, and a troubleshooting checklist for stable daily usage.
Gateway Configuration
Set up OpenClaw gateway for connecting with external services, APIs, and custom integrations. Build your automation ecosystem.