How to Install OpenClaw with Docker
Docker is the fastest way to get OpenClaw running with consistent, reproducible deployments. This guide covers everything from creating a docker-compose.yml file to configuring volume mounts and restart policies. You'll have a containerized OpenClaw instance running in under 30 minutes, with proper networking and data persistence.
Why This Is Hard to Do Yourself
These are the common pitfalls that trip people up.
Docker networking pitfalls
Bridge networks, port mapping, DNS resolution between containers
Image version sprawl
Multiple Docker images, no clear "official" tag, breaking changes between versions
Volume mount confusion
Config, data, and skill directories all need correct mounts or data is lost on restart
Container restart policies
Default containers don't restart on crash or reboot
Step-by-Step Guide
Install Docker Desktop or Engine
# macOS/Windows: Download Docker Desktop from docker.com
# Linux:
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.shCreate docker-compose.yml
version: '3.8'
services:
openclaw:
image: openclaw/openclaw:latest
ports:
- "3000:3000"
volumes:
- ./config:/app/config
- ./data:/app/data
- ./skills:/app/skills
env_file:
- .env
restart: unless-stoppedConfigure environment variables
cp .env.example .env
# Edit .env with your API keys
# ANTHROPIC_API_KEY=sk-ant-...
# OPENCLAW_GATEWAY_PORT=3000Warning: Never use the `latest` tag in production. Pin to a specific version like `openclaw/openclaw:2.4.1` to avoid unexpected breaking changes.
Create config and data directories
mkdir -p config data skills
cp gateway.example.yaml config/gateway.yaml
# Edit config/gateway.yaml for your setupLaunch with Docker Compose
docker compose up -d
docker compose logs -f # Watch logs for errorsVerify the installation
curl http://localhost:3000/health
# Should return {"status":"ok"}Docker Giving You Trouble?
Our Docker specialists handle networking, volumes, and compose configs daily. Get a production-hardened Docker setup with proper restart policies, health checks, and monitoring.
Get matched with a specialist who can help.
Sign Up for Expert Help โ