OpenClaw guide

OpenClaw is an open-source, local, self-hosted AI execution engine. One Gateway is one trust boundary: a personal assistant, not a shared bot for people who do not trust each other. Split untrusted users across Gateways, OS users or containers. A production line uses crusbro agent-OS. OpenClaw is the experiment path. Commands below are the same strings as the Chinese guide.

What it is

OpenClaw plans and carries out tasks from natural language on a machine you control. The project is MIT-licensed. Peter Steinberger led the work; the OpenClaw name was set in January 2026. By February 2026 the GitHub repository had passed 186,000 stars. Your data stays on your host unless you configure a channel that sends it out.

Thirty minutes

The first success is a dashboard you can open and a message you can send. You need a model (Claude, GPT, Ollama, or, in China, Qwen, GLM or Kimi), a channel or just the dashboard, and a host that stays up (this machine, WSL2, or Docker). Check health with:

openclaw status
openclaw gateway status
openclaw logs --follow
openclaw doctor
openclaw channels status --probe

On Windows, install Ubuntu under WSL, enable systemd, then onboard:

wsl --install
wsl --list --online
wsl --install -d Ubuntu-24.04
sudo tee /etc/wsl.conf >/dev/null <<'EOF'
[boot]
systemd=true
EOF
wsl --shutdown
openclaw onboard --install-daemon
openclaw dashboard

Running it in China

Three things decide whether the first hour works: whether the host can reach the model API, which model you pick, and which chat channel you attach. Learn on a laptop. For a service that stays up, use a domestic cloud with a compliant egress, or a Hong Kong or Singapore node when the model API is overseas.

Qwen portal auth:

openclaw plugins enable qwen-portal-auth
openclaw models auth login --provider qwen-portal --set-default
openclaw models set qwen-portal/coder-model

GLM (Z.ai):

openclaw onboard --auth-choice zai-api-key
{
  env: { ZAI_API_KEY: "sk-..." },
  agents: { defaults: { model: { primary: "zai/glm-5" } } },
}

Kimi, with the China endpoint:

openclaw onboard --auth-choice moonshot-api-key
{
  env: { MOONSHOT_API_KEY: "sk-..." },
  agents: { defaults: { model: { primary: "moonshot/kimi-k2.5" } } },
  models: {
    mode: "merge",
    providers: {
      moonshot: {
        baseUrl: "https://api.moonshot.cn/v1",
        apiKey: "${MOONSHOT_API_KEY}",
        api: "openai-completions",
      },
    },
  },
}

Feishu is the usual enterprise channel. Pairing is the default so strangers cannot drive the bot:

{
  channels: {
    feishu: {
      enabled: true,
      dmPolicy: "pairing",
      accounts: {
        main: { appId: "cli_xxx", appSecret: "xxx", botName: "企业 AI 助手" },
      },
    },
  },
}

What it does

Data stays on the host by default. Models can be Claude, GPT, Ollama or the China endpoints above, with a written fallback. Channels include Telegram, WhatsApp, Discord, DingTalk, Feishu, QQ, Slack, iMessage, Google Chat, Signal and Mattermost. Skills add tools. OpenClaw does not search or edit files until you install a skill.

Gateway and nodes

The Gateway loads config, attaches channels, routes sessions and serves RPC. The default port is 18789. Config is ~/.openclaw/openclaw.json (JSON5, comments and trailing commas allowed). Nodes are the iOS, Android, Windows, macOS and Linux clients. The web dashboard talks to the same Gateway. If the dashboard cannot connect, the failure is on this socket, not in the prompt.

Skills and ClawHub

A skill is a directory with a SKILL.md and its dependencies. ClawHub listed more than 1,700 skills by 2026. Install the CLI once, then search and install:

npm i -g clawhub --registry https://registry.npmmirror.com
clawhub search "日历"
clawhub install browser
clawhub update --all

A skill that does not appear after install is usually the wrong workspace or a Gateway that was not restarted. Run openclaw doctor and read the skill path it prints.

Deploy

The minimum host is the CLI plus a process that stays up. On WSL, allow the user service to run without a login, install the Gateway, and start WSL at boot:

sudo loginctl enable-linger "$(whoami)"
openclaw gateway install
schtasks /create /tn "WSL Boot" /tr "wsl.exe -d Ubuntu-24.04 --exec /bin/true" /sc onstart /ru SYSTEM

From a checkout:

./docker-setup.sh
# http://127.0.0.1:18789/
docker build -t openclaw:local -f Dockerfile .
docker compose run --rm openclaw-cli onboard
docker compose up -d openclaw-gateway
docker compose run --rm openclaw-cli dashboard --no-open

Approve a device before it can join:

docker compose run --rm openclaw-cli devices list
docker compose run --rm openclaw-cli devices approve <requestId>

Production layout keeps state off the image and publishes the Gateway only on loopback. Put TLS on a reverse proxy. The compose example pins the idea; lock the image tag to the release you actually run:

services:
  openclaw-gateway:
    image: ghcr.io/openclaw/openclaw:latest
    restart: unless-stopped
    environment:
      - OPENCLAW_GATEWAY_TOKEN=${OPENCLAW_TOKEN}
      - TZ=Asia/Shanghai
    volumes:
      - ./state:/home/node/.openclaw
    ports:
      - "127.0.0.1:18789:18789"

The proxy must forward the WebSocket upgrade. Without Upgrade and Connection, the dashboard connects and then drops.

Config

If ~/.openclaw/openclaw.json is missing, OpenClaw uses its safe defaults: a built-in agent, a session per sender, workspace ~/.openclaw/workspace. Configure channels and gateway.auth first. Add agents, tools and logging after openclaw doctor is clean. Unknown keys are schema errors, not ignored hints.

Channels

Telegram uses channels.telegram.botToken, group allow-lists and requireMention. WhatsApp runs through the Gateway Web channel; dmPolicy is pairing, allowlist, open or disabled. Feishu pairing is approved with a code:

openclaw gateway
openclaw logs --follow
openclaw pairing list feishu
openclaw pairing approve feishu <CODE>

QQ over OneBot stays on a local WebSocket and still requires a mention in groups. Direct messages use pairing so an unknown sender cannot spend your model quota.

Patterns you can copy

Start with a support group that replies only when mentioned, and deny tools that can spawn sessions or touch the Gateway:

{
  channels: {
    telegram: {
      groups: { "-1001234567890": { requireMention: true } },
    },
  },
  tools: { profile: "messaging", deny: ["gateway", "cron", "sessions_spawn", "sessions_send"] },
}

Other patterns in the Chinese guide, kept as operator instructions rather than new product claims: a weekly meal plan that fills a cart and stops before payment; a pull-request review that returns five issues and a merge suggestion; an invoice folder that emits a CSV and files by month and supplier; a ticket template with reproduction steps; an answer that must quote a file name and a passage; a daily note with done, blocked and next; a primary Kimi route that falls back to GLM and reports which model ran.

Gateway protocol

CLI, dashboard, desktop and phone nodes all use the Gateway WebSocket. When the panel fails, look at bind address, token and device approval before you look at the model. A token mismatch and a device waiting for devices approve look similar in the UI and different in openclaw logs --follow.

Operations

openclaw doctor, openclaw logs, openclaw health and openclaw status are the first four commands. Keep the Gateway on loopback and terminate TLS on Nginx. Store OPENCLAW_TOKEN and channel tokens outside the repo. Turn on logging.redactSensitive so logs do not keep secrets.

Fixes

Q: The Gateway will not start.
Run openclaw doctor. Use openclaw doctor --fix or --yes for migrations. The JSON must match the schema: no unknown keys, no wrong types.

Q: Claude's API is unreachable from China.
Set an HTTP or SOCKS proxy on the host that runs OpenClaw, or place that host where the API is reachable. Qwen, GLM and Kimi endpoints above avoid that path.

Q: A skill installed and nothing changed.
Restart the Gateway and confirm the skill directory is the workspace openclaw doctor prints.

Words

Gateway: the process that receives messages, calls the model, calls tools and sends the reply. Node: a client device. Skill: a folder that teaches one tool. Pairing: a direct-message sender must be approved. Workspace: ~/.openclaw/workspace, the only directory file tools should see when workspaceOnly is set.

Production

Keep a separate openclaw.json for dev, test and production, or split a base file and a prod file with $include. The production block below binds loopback, scopes sessions per peer, denies session-spawn tools, limits the filesystem to the workspace, and refuses shell execution unless a person is asked:

{
  gateway: {
    mode: "local",
    bind: "loopback",
    auth: { mode: "token", token: "${OPENCLAW_TOKEN}" },
  },
  session: { dmScope: "per-channel-peer" },
  tools: {
    profile: "messaging",
    deny: ["gateway", "cron", "sessions_spawn", "sessions_send"],
    fs: { workspaceOnly: true },
    exec: { security: "deny", ask: "always" },
    elevated: { enabled: false },
  },
  logging: { redactSensitive: true },
}

Ask Crusbro

Questions about deploy, skills or a custom integration: +86 18975663434, service@crusbro.com, or the contact page. Company: Crusbro Technology Co., Ltd., No. 518 Xinzhuan Road, Shanghai.