Docker Deployment

Quick Start with Docker

Running OpenClaw in Docker is the preferred method for servers and headless environments.

docker run -d \
  --name openclaw \
  -v ~/.openclaw:/app/config \
  -e OPENAI_API_KEY=your_key_here \
  openclaw/openclaw:latest

Docker Compose (Recommended)

Create a docker-compose.yml file for easier management:

services:
  openclaw:
    image: openclaw/openclaw:latest
    container_name: openclaw
    volumes:
      - ./config:/app/config
    environment:
      - PORT=3000
    restart: unless-stopped
Volume Sharing: Ensure the local config directory has read/write permissions for the Docker user.

Sandboxing

OpenClaw Can use Docker to sandbox agent actions. To enable this, ensure your .env file has SANDBOX_TYPE=docker configured. See Security Sandboxing for details.