OpenClaw Mission Control Documentation

repository·master·Indexed 26 days ago

https://github.com/abhi1693/openclaw-mission-control

A 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.

Tokens
21K
Snippets
45
Records
138
Agent score
87%

What's inside OpenClaw Mission Control

  1. Access OpenClaw Mission Control documentation

    master

    The 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.
  2. Quickstart Mission Control with Docker Compose

    master

    To quickly bootstrap Mission Control using Docker Compose, follow these steps from the repository root:

    1. Copy the example environment file to .env.
    2. Crucial: If you are using AUTH_MODE=local, you must set the LOCAL_AUTH_TOKEN environment variable in your .env file to a non-placeholder value containing at least 50 characters.
    3. 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
  3. Perform a minimal logical database backup

    master

    To perform a logical backup of the Postgres database, use pg_dump from the host. This requires the environment variables POSTGRES_DB, POSTGRES_USER, POSTGRES_PORT, and POSTGRES_PASSWORD to be set in your .env file.

    # 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.backup
  4. Deploy Mission Control using Docker Compose

    master

    Deploy 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

    1. Configure Environment: Copy the example environment file and edit it with your specific settings.
    2. Start the Stack: Run the compose command to build and start the services in detached mode.
    3. 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
  5. Re-sync auth tokens when Mission Control and OpenClaw drift

    master

    If the AUTH_TOKEN in the gateway's agent files (e.g., TOOLS.md) does not match the hash stored in Mission Control, heartbeats will fail with a 401 error 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_TOKEN into 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-tokens
  6. Install and enable Mission Control as User Systemd units

    master

    For 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 $USER after installation.

    Steps:

    1. Copy the generated .service files to ~/.config/systemd/user/.
    2. Reload the systemd daemon.
    3. 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
  7. Enable support for self-signed TLS certificates

    master

    If you are using wss:// connections with self-signed certificates, you can disable TLS certificate verification for a specific gateway by following these steps:

    1. Navigate to the gateway configuration page (SettingsGateways).
    2. 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.

  8. Install and Configure OpenClaw via CLI

    master

    For OpenClaw CLI installations, the default configuration file is located at ~/.openclaw/openclaw.json.

    To set up a new installation:

    1. Create the configuration directory:
      mkdir -p ~/.openclaw
    2. Save your configuration JSON to ~/.openclaw/openclaw.json.
    3. Start the gateway:
      openclaw gateway
    4. Verify the system health:
      openclaw health
    5. Access the control UI:
      openclaw dashboard
    mkdir -p ~/.openclaw
    # Save JSON to ~/.openclaw/openclaw.json
    openclaw gateway
    openclaw health
    openclaw dashboard
  9. Upgrade or rollback Mission Control

    master

    Upgrade

    To upgrade the deployment using Docker Compose, run:

    docker compose -f compose.yml --env-file .env up -d --build

    Rollback

    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.

  10. Configure Mission Control to run at login on macOS (launchd)

    master

    To run Mission Control on macOS, use LaunchAgents so the backend, frontend, and worker run under your user and restart on failure.

    1. Create a .plist file for each process (backend, frontend, and worker) in ~/Library/LaunchAgents/.
    2. For the backend, ensure the WorkingDirectory is set to REPO_ROOT/backend and uv is included in the PATH.
    3. 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 (with WorkingDirectory=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>