Managed OpenClaw instances in Docker.
Spin up sandboxed, persona-seeded OpenClaw containers. Each instance gets its own config, workspace, and identity β fully isolated from the others.
oc-hatchery/
βββ template/ # Base container template
β βββ Dockerfile
β βββ docker-compose.yml
β βββ .env.example
βββ instances/ # Local only (gitignored)
β βββ my-advisor/
β βββ docker-compose.yml
β βββ workspace/
βββ scripts/
β βββ hatch.sh # Scaffold a new instance
β βββ fleet.sh # Manage running instances
- Docker 20.10+ and Docker Compose v2.0+
- At least one LLM API key (Anthropic, OpenAI, etc.)
# 1. Create an instance (port auto-assigned starting from 18789)
./scripts/hatch.sh my-advisor
# 2. Configure API keys
cd instances/my-advisor
cp .env.example .env
# Edit .env and add your ANTHROPIC_API_KEY or OPENAI_API_KEY
# 3. Launch
docker compose up -d --build
# 4. Verify (wait ~30s for startup)
curl http://localhost:18789/health
# 5. Access the TUI
open http://localhost:18789 # or visit in browserEdit workspace files to define personality and behavior:
workspace/SOUL.mdβ personality and expertiseworkspace/IDENTITY.mdβ name, role, emojiworkspace/USER.mdβ who this instance helpsworkspace/reference/β add reference documents
Each instance uses environment variable templating for secure configuration:
.envβ Your API keys and secrets (never committed)openclaw.template.jsonβ Config template with$VARIABLEplaceholdersopenclaw.jsonβ Generated at runtime (never committed)
At container startup, the entrypoint script runs envsubst to replace variables like $ANTHROPIC_API_KEY with values from your .env file. This ensures secrets are never stored in version control.
See template/VARS.md for a complete list of supported environment variables.
Fleet management commands for easy instance control:
# View all instances with status and uptime
./scripts/fleet.sh status
# Start all instances or a specific one
./scripts/fleet.sh start # all instances
./scripts/fleet.sh start my-advisor # specific instance
# Stop all instances or a specific one
./scripts/fleet.sh stop # all instances
./scripts/fleet.sh stop my-advisor # specific instance
# View logs from an instance
./scripts/fleet.sh logs my-advisor
# Update instances (pull latest image and restart)
./scripts/fleet.sh update my-advisor # specific instance
./scripts/fleet.sh update --all # all instances
# Or manage individual instances directly
cd instances/my-advisor && docker compose downPort Management:
- Ports are automatically assigned starting from 18789 when creating instances
- Manually specify a port with
./scripts/hatch.sh my-instance --port 18800 - Port assignments are tracked in
fleet.jsonto prevent conflicts
See TESTING.md for troubleshooting.
Run the quick test (no Docker required):
./scripts/test-hatch.shValidate the Dockerfile configuration:
./scripts/validate-dockerfile.shRun the full end-to-end test:
./scripts/e2e-test.shSee TESTING.md for detailed testing guide and troubleshooting.
See DOCKERFILE_VALIDATION.md for comprehensive Dockerfile validation results.
π§ Work in progress. Scaffolding validated, Docker workflow under test.
- Docker + Docker Compose
- At least one LLM API key (Anthropic, OpenAI, etc.)
MIT
Part of the OpenClaw ecosystem. π¦