‹ 返回笔记 Esc·

OpenClaw 问题与修复

在ECS实例中部署了OpenClaw,如何打开WebUI? 1. 在实例安全组“入方向”放通“18789”端口。 2. 获取 OpenClaw 授权 Token,位于 .openclaw/opencl…

在ECS实例中部署了OpenClaw,如何打开WebUI?

  1. 在实例安全组“入方向”放通“18789”端口。
  2. 获取 OpenClaw 授权 Token,位于 .openclaw/openclaw.json -> gateway-auth-token
  3. 本地 PC 执行如下命令,将本地 PC 的 18789 端口映射到 OpenClaw 服务器的 127.0.0.1:18789 端口
1ssh -N -L 18789:127.0.0.1:18789 <user>@<your-server-ip>
  1. 后台访问地址如下
1http://127.0.0.1:18789?token=<your_token>
2# 565d2a510708d44cb316ffc3df7c17248009acc8c7dbf62a

SSL 域名访问后台

1{
2  "gateway": {
3    "bind": "127.0.0.1",
4    "port": 18789,
5    "trustedProxies": ["127.0.0.1"],
6    "auth": {
7      "mode": "password",
8      "password": "StrongPassword123"
9    },
10    "controlUi": {
11      "enabled": true,
12      "allowedOrigins": [
13        "https://ai.example.com"
14      ]
15    }
16  }
17}

重新配置模型提供商

1  ~ openclaw configure
2
3🦞 OpenClaw 2026.3.8 (3caab92) — Your task has been queued; your dignity has been deprecated.
4
5▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
6██░▄▄▄░██░▄▄░██░▄▄▄██░▀██░██░▄▄▀██░████░▄▄▀██░███░██
7██░███░██░▀▀░██░▄▄▄██░█░█░██░█████░████░▀▀░██░█░█░██
8██░▀▀▀░██░█████░▀▀▀██░██▄░██░▀▀▄██░▀▀░█░██░██▄▀▄▀▄██
9▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
10                  🦞 OPENCLAW 🦞
11
12  OpenClaw configure
13
14  Existing config detected ─────────╮
15
16  workspace: ~/.openclaw/workspace
17  model: zai/glm-5
18  gateway.mode: local
19  gateway.port: 18789
20  gateway.bind: loopback
21
22├────────────────────────────────────╯
23
24  Where will the Gateway run?
25  Local (this machine)
26
27  Select sections to configure
28  Model
29
30  Model/auth provider
31  Z.AI
32
33  Z.AI auth method
34  Coding-Plan-CN
35
36  How do you want to provide this API key?
37  Paste API key now
38
39  Enter Z.AI API key
40  fccc915701fe4470a7cd1ca2229dd0e7.j5aSG7km8N1LcJc9
41
42  Model configured ───────────────╮
43
44  Default model set to zai/glm-5
45
46├──────────────────────────────────╯
47
48  Models in /model picker (multi-select)
49  3 items selected
50Config overwrite: /home/ecs-user/.openclaw/openclaw.json (sha256 c38ea6b1c5791836569f43e0fe2d097196f86951c14699a22ff90f146c7b8a25 -> 2c5d3a5796a60145c7b89b8bcea57d32f3f30871fd7c78b1ccce582df3fb9b98, backup=/home/ecs-user/.openclaw/openclaw.json.bak)
51Updated ~/.openclaw/openclaw.json
52
53  Select sections to configure
54  Continue
55
56  Control UI ───────────────────────────────────────────────────────────────────────────────╮
57
58  Web UI: http://127.0.0.1:18789/
59  Gateway WS: ws://127.0.0.1:18789
60  Gateway: not detected (gateway closed (1006 abnormal closure (no close frame)): no close  │
61  reason)                                                                                   │
62  Docs: https://docs.openclaw.ai/web/control-ui
63
64├────────────────────────────────────────────────────────────────────────────────────────────╯
65
66  Configure complete.

新设备网关配对

1pairing required
2此设备需要网关主机的配对批准。
3openclaw devices list
4openclaw devices approve <requestId>
5在手机上?从桌面运行 openclaw dashboard --no-open 复制完整 URL(包括 #token=...)。
6Docs: Device pairing

网页连接

  1. 在主机上启动网关:
1 openclaw gateway run
  1. 获取带令牌的仪表盘 URL:
1openclaw dashboard
  1. 将 WebSocket URL 和令牌粘贴到上方,或直接打开带令牌的 URL。