6.0 KiB
OpenClaw Gateway Base Config (Local)
This document explains a "base" OpenClaw Gateway config intended for local development and LAN use, and how to connect it to Mission Control.
Related:
- Gateway WebSocket protocol: Gateway WebSocket protocol (default URL
ws://127.0.0.1:18789) - Mission Control architecture (gateway integration): Architecture deep dive
Who This Is For
Use this config if you want:
- A gateway listening locally (and optionally on your LAN)
- A predictable workspace location for agents/sessions
- A small, readable starting point you can extend
Base Config (Template)
Start from this template and change the values in Required edits.
{
"agents": {
"defaults": {
"model": {
"primary": "openai-codex/gpt-5.2"
},
"models": {
"openai-codex/gpt-5.2": {}
},
"workspace": "~/.openclaw/workspace",
"compaction": {
"mode": "safeguard"
},
"thinkingDefault": "minimal",
"maxConcurrent": 4,
"subagents": {
"maxConcurrent": 8
}
}
},
"gateway": {
"port": 18789,
"mode": "local",
"bind": "lan",
"controlUi": {
"allowInsecureAuth": true
},
"tailscale": {
"mode": "off",
"resetOnExit": false
},
"reload": {
"mode": "hot",
"debounceMs": 750
}
},
"memory": {
"backend": "qmd",
"citations": "auto",
"qmd": {
"includeDefaultMemory": true,
"update": {
"interval": "15m",
"debounceMs": 15000,
"onBoot": true
},
"limits": {
"maxResults": 6,
"maxSnippetChars": 900,
"maxInjectedChars": 4500,
"timeoutMs": 4000
}
}
},
"skills": {
"install": {
"nodeManager": "npm"
}
}
}
Required Edits
agents.defaults.workspace- Set a directory the gateway can read/write.
- Recommended default is
~/.openclaw/workspace(Mission Control defaults the "workspace root" UI to~/.openclaw).
Optional Edits (Common)
gateway.bind"lan"is convenient for reaching the gateway from another machine on your network.- If you want local-only access, configure your gateway to bind only to localhost/loopback (exact values depend on the gateway build) and/or firewall the port.
gateway.port- Change if
18789is already in use. - Mission Control requires the URL to include an explicit port (example:
ws://127.0.0.1:18789).
- Change if
agents.defaults.model.primary- Set your preferred default model identifier.
memory.qmd.limits- Tune memory query/injection sizes if you see timeouts or overly-large prompts.
What Each Top-Level Section Does
agents.defaults
Default runtime behavior for agents created/managed by the gateway:
model.primary: default model identifiermodels: per-model overrides (empty means "use provider defaults")workspace: where agent state/files live on diskcompaction.mode: "safeguard": enables conservative compaction behaviorthinkingDefault: "minimal": default "thinking" levelmaxConcurrent: max concurrent top-level runssubagents.maxConcurrent: max concurrent subagent runs
gateway
Network/runtime settings for the gateway service itself:
port: TCP port for the WebSocket server (protocol doc defaults to18789)mode: "local": local mode (vs remote-managed)bind: "lan": binds in a way that's reachable from your LAN (treat as "network exposed")controlUi.allowInsecureAuth: true: convenience for local dev; do not use as-is for productiontailscale.mode: "off": disables Tailscale integration by defaultreload.mode: "hot"+reload.debounceMs: enables hot reload of config with a debounce window
memory
Configures the gateway's memory subsystem.
backend: "qmd": use the QMD backendcitations: "auto": automatically include citations when supportedqmd.includeDefaultMemory: includes default memory sourcesqmd.update: periodic update settingsqmd.limits: bounds for query size/latency and injected context
skills.install.nodeManager
Controls which Node package manager is used for skill installation.
"npm"is the most compatible baseline.
Connecting Mission Control To The Gateway
Mission Control connects over WebSockets and supports passing a token.
What Mission Control expects:
- Gateway URL must be
ws://...orwss://...and must include an explicit port. - Token is optional. Empty/whitespace tokens are treated as "no token" by the Mission Control API.
In the Mission Control UI:
- Go to "Gateways" and add a new gateway.
- Set URL to something like
ws://127.0.0.1:18789(or your LAN host/IP + port). - If your gateway is configured to require a token, paste it here. Otherwise leave blank.
- Use the "Check connection" action to confirm reachability.
Implementation note (how Mission Control sends tokens):
- If you provide a token, Mission Control's backend will include it when connecting to the gateway (it attaches it to the URL query string and also sends it in the
connectparams). Seebackend/app/services/openclaw/gateway_rpc.py.
Workspace Root (Mission Control) vs Workspace (Gateway)
Mission Control stores a workspace_root value per gateway (configured in the UI). This is used when generating agent context/templates (for example, to compute a per-agent workspace_path). See backend/app/services/openclaw/provisioning.py.
The gateway config's agents.defaults.workspace is a separate setting that controls where the gateway runtime actually reads/writes agent state on disk.
For the smoothest onboarding, set these so the paths you show agents match what exists on the gateway host.
Security Notes (Read This If You Expose The Gateway)
- Treat
gateway.bind: "lan"as "this is reachable by other devices on your network". controlUi.allowInsecureAuth: trueis for convenience in local dev. If you run this beyond your laptop, tighten this setting and prefer TLS (wss://) and network-level protections.