DockerSetup

Docker Setup & Compose Patterns

Run OpenClaw in Docker with production-ready compose files, volume mounts, and health checks.

12 min readLast updated Feb 8, 2026
Stuck?Check the troubleshooting index or ask in Discord.

Overview

Docker is the recommended deployment method for OpenClaw in production. This guide covers creating a production-ready Docker Compose setup with proper volume mounts, health checks, and resource constraints.

Compose File

Create a docker-compose.yml in your project root:

docker-compose.yml
version: "3.8"
services:
  openclaw:
    image: openclaw/openclaw:latest
    container_name: openclaw
    restart: unless-stopped
    ports:
      - "3000:3000"
    volumes:
      - openclaw_data:/app/data
      - ./config:/app/config:ro
    environment:
      - MODEL_BACKEND_URL=http://host.docker.internal:11434
      - LOG_LEVEL=info
    deploy:
      resources:
        limits:
          memory: 2G
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 15s

volumes:
  openclaw_data:

Volumes & Persistence

The openclaw_data volume stores the SQLite database and uploaded files. Always use a named volume in production to survive container recreation.

Backup your data
Before upgrading, always back up the data volume. You can export it with docker cp openclaw:/app/data ./backup.

Health Checks

The health check configuration above ensures Docker knows when the service is ready. This is critical if you use orchestrators or reverse proxies that depend on container health state.

bash
# Check container health manually
docker inspect --format='{{.State.Health.Status}}' openclaw

Search OpenClaw Center

Search guides, troubleshooting entries, and resources.