OpenClaw Agent Instance Setup
Each service in the OpenClaw fleet reads:
- A per-agent environment file:
docker/openclaw-instances/<agent>.env - A per-agent JSON5 config:
docker/openclaw-instances/<agent>.json
1. Fill in API keys in .env files
Set ZAI_API_KEY in each instance env file:
jarvis-main.envjarvis-projects.envjarvis-research.envjarvis-operations.env
2. Generate unique gateway tokens per agent
Generate one token per instance:
openssl rand -hex 32
Set a different OPENCLAW_GATEWAY_TOKEN in each .env file.
3. Deploy the Docker Swarm stack
From repository root:
docker stack deploy -c docker/openclaw-compose.yml jarvis
4. First-time auth (if needed)
If an instance requires first-time login, exec into the running container and run:
openclaw auth
This uses OpenClaw's headless OAuth device-code flow.
5. Use Mosaic WebUI terminal for auth
You can complete the device-code auth flow from the Mosaic WebUI terminal (xterm.js) attached to the service container.