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 higherQuick Start with Docker
Pull and Run
docker run -d \
--name openclaw \
-p 18789:18789 \
-v ~/.openclaw:/root/.openclaw \
openclaw/openclaw:latestUsing Docker Compose (Recommended)
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 -dConfiguration
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:latestEnvironment Variables
| Variable | Default | Description |
|---|---|---|
OPENCLAW_HOME | /root/.openclaw | Home directory |
OPENCLAW_STATE_DIR | $OPENCLAW_HOME/state | State directory |
OPENCLAW_CONFIG_PATH | $OPENCLAW_HOME/openclaw.json | Config 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 openclawUpdating
# Pull the latest image
docker pull openclaw/openclaw:latest
# Recreate the container
docker compose down
docker compose up -dData 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 openclawPort conflict
Change the host port mapping:
docker run -d -p 18790:18789 openclaw/openclaw:latestPermission issues
Ensure the mounted volume has the correct permissions:
chmod -R 755 ~/.openclawNext Steps
- Quick Start — Complete setup guide
- Windows Installation — Native Windows setup
- macOS Installation — Native macOS setup
- AI Model Integrations — Connect your AI model