Overview
Advantages
- Portable
- Reproducible
- Isolation
- Easy backup
Considerations
- Docker overhead
- Additional complexity
- Storage management
Requirements
- Docker: Docker Engine 20.10+
- Docker Compose: For multi-container orchestration
Setup Steps
- Create Dockerfile: Create a Dockerfile for OpenClaw
- Create docker-compose.yml: Set up Docker Compose configuration
- Build Image: Build the Docker image
docker compose build - Start Container: Start the container
docker compose up -d - Run Onboarding: Complete setup inside container
docker compose exec openclaw openclaw onboard
Configuration Example
# docker-compose.yml
version: '3.8'
services:
openclaw:
image: node:22-slim
command: ["sh", "-c", "npm install -g openclaw@latest && openclaw gateway"]
ports:
- "18789:18789"
volumes:
- openclaw_data:/root/.openclaw
environment:
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
restart: unless-stopped
volumes:
openclaw_data: Deploy with AI Providers
Choose your AI provider for docker deployment deployment:
Anthropic
Creator of Claude AI models with advanced reasoning capabilities
OpenAI Codex
GPT models with broad capabilities and wide ecosystem support
Google Gemini
Multimodal AI with competitive pricing and speed
OpenRouter
Unified API gateway to multiple AI providers
Ollama
Run open-source LLMs locally with no API costs
AWS Bedrock
Enterprise AI through AWS with compliance and security
OpenAI (Standard)
Standard OpenAI API for GPT models
Frequently Asked Questions
What are the requirements for Docker Deployment?
Docker Deployment requires: Docker. The setup typically takes 15-30 minutes for first-time users.
Where is state stored with Docker Deployment?
State is stored in /root/.openclaw (mounted volume). This includes configuration, credentials, session history, and workspace files. Always back up this directory.