Install with Docker

Deploy OpenClaw using Docker for a containerized, reproducible setup.

Prerequisites

  • Docker — Install from docker.com
  • Docker Compose (optional, recommended)

Verify Docker is installed:

docker --version
# Expected: Docker version 24.x or higher

Quick Start with Docker

Pull and Run

docker run -d \
  --name openclaw \
  -p 18789:18789 \
  -v ~/.openclaw:/root/.openclaw \
  openclaw/openclaw:latest

Create a docker-compose.yml file:

version: '3.8'

services:
  openclaw:
    image: openclaw/openclaw:latest
    container_name: openclaw
    ports:
      - "18789:18789"
    volumes:
      - openclaw-data:/root/.openclaw
    environment:
      - OPENCLAW_HOME=/root/.openclaw
    restart: unless-stopped

volumes:
  openclaw-data:

Start the service:

docker compose up -d

Configuration

Mount Configuration File

To use a custom configuration, mount your config file:

docker run -d \
  --name openclaw \
  -p 18789:18789 \
  -v ~/.openclaw:/root/.openclaw \
  -v ./openclaw.json:/root/.openclaw/openclaw.json \
  openclaw/openclaw:latest

Environment Variables

VariableDefaultDescription
OPENCLAW_HOME/root/.openclawHome directory
OPENCLAW_STATE_DIR$OPENCLAW_HOME/stateState directory
OPENCLAW_CONFIG_PATH$OPENCLAW_HOME/openclaw.jsonConfig file path

Container Management

# View logs
docker logs -f openclaw

# Stop the container
docker stop openclaw

# Restart the container
docker restart openclaw

# Remove the container
docker rm -f openclaw

Updating

# Pull the latest image
docker pull openclaw/openclaw:latest

# Recreate the container
docker compose down
docker compose up -d

Data Persistence

The ~/.openclaw volume stores:

  • Configuration (openclaw.json)
  • Session data
  • Memory storage
  • Channel credentials

Always mount this volume to persist data between container restarts.

Troubleshooting

Container exits immediately

Check the logs:

docker logs openclaw

Port conflict

Change the host port mapping:

docker run -d -p 18790:18789 openclaw/openclaw:latest

Permission issues

Ensure the mounted volume has the correct permissions:

chmod -R 755 ~/.openclaw

Next Steps