OpenClaw Mission Control Documentation
repository·master·Indexed 26 days ago
https://github.com/abhi1693/openclaw-mission-controlA centralized operations and governance platform for managing OpenClaw agents, gateways, and work orchestration. Built with a Next.js frontend, FastAPI backend, and PostgreSQL database, it provides a unified interface for visibility, approval-driven governance, and API-backed automation. The documentation covers local development, Docker Compose deployment, database migrations via Alembic, and systemd/launchd configuration for Linux and macOS.
What's inside OpenClaw Mission Control
- OpenClaw Mission Control is built using a modern web stack consisting of a Next.js frontend, a FastAPI backend, and a PostgreSQL database for persistence.
Access OpenClaw Mission Control documentation
masterThe Mission Control documentation is organized into several key areas for developers and operators:
Setup and Operations
- Getting started: Initial setup and usage.
- Development: Instructions for local development.
- Testing: Guidance on running tests.
- Deployment: Procedures for deploying the platform.
- Operations: Managing a running instance.
- Troubleshooting: General troubleshooting and specific guides for Gateway agent provisioning and check-in issues.
Reference and Protocols
- Configuration reference: Detailed documentation of configuration keys.
- Authentication: Information on security and identity management.
- API notes: Technical details regarding the API surface.
- Gateway WebSocket protocol: Specification for the Gateway WebSocket communication.
Quickstart Mission Control with Docker Compose
masterTo quickly bootstrap Mission Control using Docker Compose, follow these steps from the repository root:
- Copy the example environment file to
.env. - Crucial: If you are using
AUTH_MODE=local, you must set theLOCAL_AUTH_TOKENenvironment variable in your.envfile to a non-placeholder value containing at least 50 characters. - Run the Docker Compose command to build and start the services in detached mode.
Once running, the services are available at:
- Frontend:
http://localhost:3000 - Backend health check:
http://localhost:8000/healthz
cp .env.example .env # Ensure LOCAL_AUTH_TOKEN is set in .env if AUTH_MODE=local docker compose -f compose.yml --env-file .env up -d --build- Copy the example environment file to
Perform a minimal logical database backup
masterTo perform a logical backup of the Postgres database, use
pg_dumpfrom the host. This requires the environment variablesPOSTGRES_DB,POSTGRES_USER,POSTGRES_PORT, andPOSTGRES_PASSWORDto be set in your.envfile.# load variables from .env (trusted file only) set -a . ./.env set +a : "${POSTGRES_DB:?set POSTGRES_DB in .env}" : "${POSTGRES_USER:?set POSTGRES_USER in .env}" : "${POSTGRES_PORT:?set POSTGRES_PORT in .env}" : "${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env (strong, unique value; not \"postgres\")}" PGPASSWORD="$POSTGRES_PASSWORD" pg_dump \ -h 127.0.0.1 -p "$POSTGRES_PORT" -U "$POSTGRES_USER" \ -d "$POSTGRES_DB" \ --format=custom > mission_control.backupDeploy Mission Control using Docker Compose
masterDeploy Mission Control in a single-host environment using Docker Compose.
Prerequisites
- Docker + Docker Compose v2 (
docker compose) - A host where the browser can reach the backend URL configured in
NEXT_PUBLIC_API_URL.
Setup Steps
- Configure Environment: Copy the example environment file and edit it with your specific settings.
- Start the Stack: Run the compose command to build and start the services in detached mode.
- Verify: Check the backend health endpoint to ensure the services are running correctly.
Accessing the Application
- Frontend:
http://localhost:${FRONTEND_PORT:-3000} - Backend Health:
http://localhost:${BACKEND_PORT:-8000}/healthz
- Docker + Docker Compose v2 (
Re-sync auth tokens when Mission Control and OpenClaw drift
masterIf the
AUTH_TOKENin the gateway's agent files (e.g.,TOOLS.md) does not match the hash stored in Mission Control, heartbeats will fail with a401error and the agent will appear offline. This often happens after reinstalls or manual edits.To fix this, perform a template sync with token rotation. This forces the backend to issue new agent tokens and rewrite the
AUTH_TOKENinto the gateway's agent files.Note: After syncing, if the gateway was offline, you must trigger a wake/update from Mission Control so agents restart and pick up the new token.
### Via API (curl) ```bash curl -X POST "http://localhost:8000/api/v1/gateways/GATEWAY_ID/templates/sync?rotate_tokens=true" \ -H "Authorization: Bearer YOUR_LOCAL_AUTH_TOKEN"Via CLI (from repo root)
cd backend && uv run python scripts/sync_gateway_templates.py --gateway-id GATEWAY_ID --rotate-tokensRun Mission Control Frontend on a LAN
masterTo allow other devices on your local network to access the development server, bind the Next.js dev server to all interfaces using the
dev:lanscript.npm run dev:lanInstall and enable Mission Control as User Systemd units
masterFor single-user environments or VMs, use user-level systemd units. These services start at user login by default. To ensure they start at machine boot without requiring a manual login, run
loginctl enable-linger $USERafter installation.Steps:
- Copy the generated
.servicefiles to~/.config/systemd/user/. - Reload the systemd daemon.
- Enable and start the backend, frontend, and RQ worker services.
cp openclaw-mission-control-backend.service openclaw-mission-control-frontend.service openclaw-mission-control-rq-worker.service ~/.config/systemd/user/ systemctl --user daemon-reload systemctl --user enable openclaw-mission-control-backend openclaw-mission-control-frontend openclaw-mission-control-rq-worker systemctl --user start openclaw-mission-control-backend openclaw-mission-control-frontend openclaw-mission-control-rq-worker- Copy the generated
Enable support for self-signed TLS certificates
masterIf you are using
wss://connections with self-signed certificates, you can disable TLS certificate verification for a specific gateway by following these steps:- Navigate to the gateway configuration page (Settings → Gateways).
- When creating or editing a gateway, enable the toggle: "Allow self-signed TLS certificates".
Security Warning: Enabling this weakens transport security. Only use this when you explicitly trust the endpoint and network path. For production environments, prefer valid CA-signed certificates.
Install and Configure OpenClaw via CLI
masterFor OpenClaw CLI installations, the default configuration file is located at
~/.openclaw/openclaw.json.To set up a new installation:
- Create the configuration directory:
mkdir -p ~/.openclaw - Save your configuration JSON to
~/.openclaw/openclaw.json. - Start the gateway:
openclaw gateway - Verify the system health:
openclaw health - Access the control UI:
openclaw dashboard
mkdir -p ~/.openclaw # Save JSON to ~/.openclaw/openclaw.json openclaw gateway openclaw health openclaw dashboard- Create the configuration directory:
Upgrade or rollback Mission Control
masterUpgrade
To upgrade the deployment using Docker Compose, run:
docker compose -f compose.yml --env-file .env up -d --buildRollback
Rollback involves deploying a previous image or commit.
Warning: If you have applied non-backward-compatible database migrations, rolling back the application code may require a database restore to a previous state.
Configure Mission Control to run at login on macOS (launchd)
masterTo run Mission Control on macOS, use
LaunchAgentsso the backend, frontend, and worker run under your user and restart on failure.- Create a
.plistfile for each process (backend, frontend, and worker) in~/Library/LaunchAgents/. - For the backend, ensure the
WorkingDirectoryis set toREPO_ROOT/backendanduvis included in thePATH. - Load the agents using
launchctl load.
Required Services
- Backend: Runs via
uv run uvicorn app.main:app. - Frontend: Runs via
npm run start -- --hostname 0.0.0.0 --port 3000. - RQ Worker: Runs via
uv run python ../scripts/rq worker(withWorkingDirectory=REPO_ROOT/backend).
# Example backend plist snippet <dict> <key>Label</key> <string>com.openclaw.mission-control.backend</string> <key>ProgramArguments</key> <array> <string>/usr/bin/env</string> <string>uv</string> <string>run</string> <string>uvicorn</string> <string>app.main:app</string> <string>--host</string> <string>0.0.0.0</string> <string>--port</string> <string>8000</string> </array> <key>WorkingDirectory</key> <string>REPO_ROOT/backend</string> <key>KeepAlive</key> <true/> <key>RunAtLoad</key> <true/> </dict>- Create a