๐Ÿš€Setup & Installation

How to Install OpenClaw with Docker

Intermediate20-45 minutesUpdated 2025-01-20

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

Step 1

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.sh
Step 2

Create 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-stopped
Step 3

Configure environment variables

cp .env.example .env
# Edit .env with your API keys
# ANTHROPIC_API_KEY=sk-ant-...
# OPENCLAW_GATEWAY_PORT=3000

Warning: Never use the `latest` tag in production. Pin to a specific version like `openclaw/openclaw:2.4.1` to avoid unexpected breaking changes.

Step 4

Create config and data directories

mkdir -p config data skills
cp gateway.example.yaml config/gateway.yaml
# Edit config/gateway.yaml for your setup
Step 5

Launch with Docker Compose

docker compose up -d
docker compose logs -f  # Watch logs for errors
Step 6

Verify 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 โ†’

Frequently Asked Questions