OpenClaw#
OpenClaw is a self-hosted gateway that connects chat apps and messaging surfaces to AI agents. A single Gateway process runs on your machine or server and routes messages from channels such as Discord, Google Chat, iMessage, Matrix, Microsoft Teams, Signal, Slack, Telegram, WhatsApp, Zalo, and others into agent sessions.
The Gateway owns session routing, transcript persistence, and the built-in agent runtime. It exposes a WebSocket control plane (default port 18789) plus HTTP surfaces for health checks, OpenAI-compatible inference, and plugin routes. All surfaces respect the active gateway.auth mode and bind settings.
How the Gateway works#
Inbound events from channels flow through the Gateway into sessions. The agent runtime executes turns, invokes tools, and produces output that the Gateway delivers back through the originating channel. The same Gateway also serves the Control UI, accepts CLI commands, and coordinates companion nodes.
Key surfaces:
openclaw gatewaystarts or manages the process (foreground or daemon).- Sessions group messages by
dmScope(defaultmain) and optional thread bindings. - The built-in runtime (
openclaw) handles model calls, tool execution, compaction, and heartbeats.
Installation and first run#
npm install -g openclaw@latest
openclaw onboard --install-daemon
onboard walks through gateway, workspace, channel, and skill setup. --install-daemon registers a user-level launchd or systemd service. From source, use pnpm openclaw onboard --install-daemon.
After the Gateway is running, open the Control UI:
openclaw dashboard
Local default: http://127.0.0.1:18789.
Configuration#
Settings live in ~/.openclaw/openclaw.json (JSON5). If the file is absent, safe defaults apply. Use the CLI for edits:
openclaw config get agents.defaults.workspace
openclaw config set agents.defaults.heartbeat.every "2h"
openclaw config schema
Example channel policy:
{
channels: {
whatsapp: {
allowFrom: ["+15555550123"],
groups: { "*": { requireMention: true } },
},
},
messages: { groupChat: { mentionPatterns: ["@openclaw"] } },
}
Validation runs on load and hot reload. openclaw doctor --fix repairs common issues such as prefixed keys or invalid entries.
Next steps#
- Getting Started
- CLI overview
- Gateway configuration
- Agent runtime architecture
- Sessions and transcripts
Run openclaw doctor after upgrades or when the Gateway refuses to start.