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

  1. Create Dockerfile: Create a Dockerfile for OpenClaw
  2. Create docker-compose.yml: Set up Docker Compose configuration
  3. Build Image: Build the Docker image
    docker compose build
  4. Start Container: Start the container
    docker compose up -d
  5. 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:

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.