A lightweight CLI for managing multiple OpenClaw Docker containers on a single host.
- Rapid container deployment with a single command
- Persistent data across upgrades via Docker volumes
- Per-container environment variable management (API keys, config)
- Seamless image upgrades without data loss
- Multi-container support with automatic port assignment
- Helper commands for logs, shell access, status monitoring
# Clone and make executable (or symlink ocm into your PATH)
git clone <repo-url> && cd openclaw-docker-manager
chmod +x ocm
# Create and configure a container
./ocm create main
./ocm env main # Set your API keys (ANTHROPIC_API_KEY, etc.)
./ocm setup main # Interactive OpenClaw setup (first time only)
./ocm start main
# Check status
./ocm list
./ocm status main
./ocm logs main -focm create <name> [--tag TAG] [--port PORT] # Create a container config
ocm setup <name> # Interactive OpenClaw setup
ocm start <name> # Start a container
ocm stop <name> # Stop a container
ocm restart <name> # Restart a container
ocm rm <name> [--volumes] [--force] # Remove a containerocm list # List all containers
ocm status [name] # Show detailed container status
ocm logs <name> [-f] [-n LINES] # View container logs
ocm cli <name> [cmd...] # Shell or run openclaw commands
ocm env <name> # Edit environment variablesocm pull [tag] # Pull latest image
ocm upgrade <name> [--tag TAG] # Upgrade a single container
ocm upgrade --all [--tag TAG] # Upgrade all containersAuto-created on first run. Configures the image source and defaults:
OCM_IMAGE=ghcr.io/aaronfaby/openclaw-custom
OCM_DEFAULT_TAG=latest
OCM_PORT_START=18789
OCM_CONTAINER_PREFIX=ocmEach container has an env file editable via ocm env <name>:
# --- OCM internal (do not remove) ---
OCM_PORT=18789
OCM_TAG=latest
# --- User environment variables ---
ANTHROPIC_API_KEY=sk-ant-...
XAI_API_KEY=xai-...
OPENAI_API_KEY=sk-...OCM_PORT and OCM_TAG are used by ocm internally. All other variables are passed to the container.
Each container gets three Docker volumes that persist across restarts and upgrades:
| Volume | Container path | Contents |
|---|---|---|
ocm-<name>-config |
/home/node/.openclaw |
Configuration and auth profiles |
ocm-<name>-workspace |
/home/node/.openclaw/workspace |
Session and workspace data |
ocm-<name>-auth |
/home/node/.config/openclaw |
OAuth token encryption keys |
Volumes are not removed when you ocm rm a container unless you pass --volumes.
Upgrades pull the latest image, stop the container, remove it, and recreate it with the same configuration and volumes — your data is preserved:
ocm upgrade main # Upgrade a single container
ocm upgrade --all # Upgrade all containers
ocm upgrade main --tag oc-2026.5.22 # Pin to a specific versionocm cli main # Interactive bash shell
ocm cli main configure # Run 'openclaw configure'
ocm cli main doctor --fix # Run 'openclaw doctor --fix'
ocm cli main --raw env # Run an arbitrary commandContainers are automatically assigned incrementing ports starting from OCM_PORT_START (default 18789):
ocm create production # Port 18789
ocm create staging # Port 18790
ocm create dev --port 19000 # Explicit port
ocm create pinned --tag oc-2026.5.22 # Pinned image version- Docker
- Bash 4+