OPENCLAW-GATEWAY(7) Savvy Admin Process Reference OPENCLAW-GATEWAY(7)
NAME
openclaw-gateway — The OpenClaw Gateway: a Node.js daemon that serves the Control UI, the WebSocket and HTTP API (/v1/*, /tools/invoke, /api/channels/*) on one port, 18789 by default, and runs the agent's tools, terminal and browser control behind it.
kind: ai agent · package: openclaw (npm); OpenClaw 2026.10.5 at the time of writing · binary: node — the gateway sets its process title to openclaw-gateway (ps shows the comm field truncated to openclaw-gatewa); its helper workers show as node MainThread running dist/process/spawn-broker/worker.js and dist/infra/sqlite-readonly-location.worker.js · config: ~/.openclaw/openclaw.json (JSON5), ~/.openclaw/ (state, cache, media, credentials), /tmp/openclaw/openclaw-YYYY-MM-DD.log (file logs, as reported by openclaw gateway status) · updated 2026-10-20
docs last verified 2026-10-20 — 0 days ago
SAFE TO KILL?
SYMPTOMS
· 0.0.0.0:18789 in ss -tlnp: gateway.bind is lan or custom, so every host that can reach the machine can reach the Control UI and the tool-invocation API
· a node process with a gigabyte of RSS plus two or three node workers: the gateway and its spawn broker and sqlite workers, normal while channels and browser control are enabled
· the gateway refuses to start: openclaw.json lacks gateway.mode = "local", or no authentication is configured (auth is required by default)
WHAT IT CAN DO
Whatever its tools allow, as the user that runs it: a terminal (gateway.terminal.enabled defaults to true), browser control, elevated tools, CLI agents (gateway.cliAgents.enabled defaults to true), file uploads (gateway.uploads.enabled defaults to true), and every configured chat channel. Authentication modes are token (recommended), password, trusted-proxy and none; none is an explicit opt-in, and without a valid auth path the gateway refuses WebSocket connections. gateway.bind is loopback by default; lan (0.0.0.0), tailnet, auto and custom widen exposure, and the docs pair them with auth and a real firewall. Port precedence: --port, then OPENCLAW_GATEWAY_PORT, then gateway.port, then 18789. Changes to auth mode and TLS need a restart; most other gateway.* changes hot-reload.
LISTENS ON
18789/tcp default bind 127.0.0.1 and ::1 (gateway.bind: loopback) — WebSocket, HTTP API and Control UI share this port; lan binds 0.0.0.0
DIAGNOSE
HARDEN
1. Stay on loopback and reach it through something that authenticates you. Keep gateway.bind = "loopback". For remote access the docs recommend Tailscale Serve, which keeps the gateway on loopback; gateway.remote.transport defaults to ssh for the CLI's own remote mode. Never publish 18789 unauthenticated on 0.0.0.0, and in Docker enforce rules in the DOCKER-USER chain, since published ports bypass the host's INPUT rules.
2. Use a real token and keep it off the command line. Sets a persistent token; the audit warns on tokens shorter than 24 characters and treats blank ones as critical. openclaw gateway auth-token --show reveals it only on an interactive terminal and refuses piped output, which is the right instinct: do not paste it into scripts, use OPENCLAW_GATEWAY_TOKEN from a protected environment instead.
$ openclaw doctor --generate-gateway-token3. Lock the state directory. openclaw.json is written mode 600, but a 755 directory still lets other local users list what is there. Run the gateway under its own Unix account on a shared box.
$ chmod 700 ~/.openclaw4. Turn off the surfaces you do not use. gateway.terminal.enabled, gateway.uploads.enabled and gateway.cliAgents.enabled all default to true; the HTTP chat-completions endpoint and the admin HTTP RPC plugin default to off, keep them that way unless something needs them. The hosted widget pages under /__openclaw__/canvas carry agent-authored HTML and JavaScript; the docs say to treat them as untrusted.
5. Behind a reverse proxy, name the proxy. Set gateway.trustedProxies to the proxy addresses; otherwise the audit warns that forwarded-for headers are not trusted and the gateway cannot tell a local client from a remote one.
IMPOSTORS
DISTRIBUTIONS
any npm install -g openclaw; openclaw gateway install registers a systemd user service, launchd agent or scheduled task, openclaw gateway run starts it in the foreground. Config is JSON5 at ~/.openclaw/openclaw.json and must contain gateway.mode = "local" for the gateway to start.
APPLIES TO
OpenClaw 2026.10.x (the 2.0 line). Keys, defaults and commands taken from docs.openclaw.ai on 2026-10-20 and checked on a fresh install; this project changes monthly, see the verified date.
SEE ALSO
SOURCES
1. OpenClaw docs — Network exposure, fetched 2026-10-20
2. OpenClaw docs — Gateway configuration (gateway.bind, gateway.port, gateway.auth), fetched 2026-10-20
3. OpenClaw docs — Run the Gateway, fetched 2026-10-20
Machine-readable: /process/openclaw-gateway.json · changelog 2026-10-20: first version. On a fresh install with only gateway.mode, bind and a token set, the audit reported 0 critical, 2 warnings (trusted proxies, state dir 755) and tools.elevated plus browser control enabled by default