Deployment • TutorialHeader.readTime
Docker Deployment
Professional deployment guide for containerizing OpenClaw on servers and local machines.
Official Image
The official image is available at <code>ghcr.io/openclaw/openclaw:latest</code>. It includes all necessary dependencies for browser automation and gateway services.
Tutorial.step
Quick Start
For a quick ephemeral session, run container directly with minimal flags:
Terminal
docker run -d \ --name openclaw \ -p 18789:18789 \ -v ~/.openclaw:/root/.openclaw \ ghcr.io/openclaw/openclaw:latest \ openclaw gateway
Tutorial.step
Docker Compose (Recommended)
For production and long-term use, Docker Compose is standard way to manage your OpenClaw instance.
docker-compose.yml
version: '3.8'
services:
openclaw:
image: ghcr.io/openclaw/openclaw:latest
container_name: openclaw
restart: unless-stopped
ports:
- "18789:18789" # Gateway
- "18793:18793" # Canvas Host (Optional)
volumes:
- ~/.openclaw:/root/.openclaw # Configuration & Workspace
environment:
- NODE_ENV=production
command: openclaw gatewayTutorial.step
Volume Persistence
Critical: Data Loss Prevention
If you do not mount these volumes, your agent will lose its personality, configuration, and memories every time the container restarts.
~/.openclawStores openclaw.json, encryption keys, and channel credentials.
~/.openclaw/workspaceThe Workspace. Contains your Markdown memories, SOUL, and custom skills.
Tutorial.step
Advanced Environment Variables
PORT: Override internal gateway port.OPENCLAW_CONFIG_PATH: Path to config within container.OPENCLAW_GATEWAY_TOKEN: Force a static auth token for gateway.
Tutorial.step
Unraid & NAS Setup
When deploying on Unraid or Synology, ensure you map paths to your appdata share:
- Config Path:
/mnt/user/appdata/openclaw/configmaps to/root/.openclaw - Data Path:
/mnt/user/appdata/openclaw/workspacemaps to/root/.openclaw/workspace
Tutorial.step
Troubleshooting
Logs & Health
Terminal
docker logs -f openclaw
If you see Error: listen EADDRINUSE, another process is using port 18789. Change the host port mapping in your compose file to "18790:18789".
Architecture Depth
Learn how Docker interacts with agent loop.