Overview
Multi-Gateway support lets you connect Mission Control to multiple OpenClaw gateway instances simultaneously. Monitor connection health, switch between gateways, and manage direct CLI connections—all from a unified interface.Connect to gateways on different hosts, ports, or networks to support distributed agent fleets, dev/staging/prod environments, or high-availability configurations.
Architecture
Mission Control supports two connection types:- Gateway Connections
- Direct Connections
WebSocket connections to OpenClaw gateway servers. Each gateway can manage multiple agents.
Gateway Configuration
Database Schema
Gateways are stored in thegateways table:
Adding a Gateway
Use the UI form or API:Setting Primary Gateway
The primary gateway auto-connects on page load:WebSocket Connection
Connecting to a gateway establishes a WebSocket:Connection State
The Zustand store tracks active connection:Health Monitoring
Gateway Probing
Probe all gateways to check status and latency:Status Indicators
Gateway cards show real-time status:Direct CLI Connections
CLI tools connect via the/api/connect endpoint:
Registration
Heartbeat
CLI tools send periodic heartbeats:Disconnection
UI Components
The Multi-Gateway Panel provides full management:Best Practices
- Gateway Setup
- Health Monitoring
- Direct Connections
- Name gateways descriptively: “Production”, “Staging”, “Dev”, not “Gateway 1”
- Set primary for auto-connect: The primary gateway connects on page load
- Use secure tokens: Generate strong tokens for production gateways
- Document network topology: Keep a map of gateway hosts and ports
Troubleshooting
1
Gateway shows 'offline' status
- Verify gateway is running:
ps aux | grep openclaw - Check firewall rules allow WebSocket port (default: 18789)
- Test connectivity:
telnet <host> <port> - Review gateway logs for connection errors
2
High latency or timeouts
- Check network congestion between Mission Control and gateway
- Verify gateway host resources (CPU, memory)
- Consider geographic distribution—use local gateways when possible
- Review gateway configuration for performance tuning
3
Direct connection not appearing
- Verify agent_name matches an existing agent in database
- Check API key has
operatorrole or higher - Ensure heartbeat is sent within 60 seconds of registration
- Review Mission Control logs for auth or validation errors
Related
- Device Identity - Secure gateway authentication
- Agent Management - Managing agents across gateways
- Gateways API - Complete gateway API