安装OpenClaw

快速安装

curl -fsSL https://openclaw.ai/install.sh | bash

快速配置

◇  I understand this is personal-by-default and shared/multi-user use requires lock-down. Continue?
│ Yes

◇ Onboarding mode
│ QuickStart

◇ Model/auth provider
│ Skip for now

◇ Filter models by provider
│ All providers

◇ Default model
│ Keep current (default: anthropic/claude-opus-4-6)

◇ Select channel (QuickStart)
│ Skip for now
Updated ~/.openclaw/openclaw.json
Workspace OK: ~/.openclaw/workspace
Sessions OK: ~/.openclaw/agents/main/sessions

◇ Configure skills now? (recommended)
│ No

◇ Enable hooks?
│ Skip for now
Config overwrite: /root/.openclaw/openclaw.json (sha256 e20bf2f01a35a0877c70f2eb2ecec6dfad6b9e7b0f9cd59f2342f4706992179b -> 2829efaa7bb43b4f26346d98a3cdf72c0608746bb141eab195e4fd2967a6cda8, backup=/root/.openclaw/openclaw.json.bak)

◑ Installing Gateway service…
Installed systemd service: /root/.config/systemd/user/openclaw-gateway.service
◇ Gateway service installed.

└ Onboarding complete. Use the dashboard link above to control OpenClaw.

更改UI的默认访问IP端口

[root@VM-4-13-opencloudos ~]# openclaw configure

┌ OpenClaw configure

◇ Where will the Gateway run?
│ Local (this machine)

◇ Select sections to configure
│ Gateway

◇ Gateway port
│ 8789

◇ Gateway bind mode
│ Custom IP

◇ Custom IP address
│ 0.0.0.0

◇ Gateway auth
│ Token

◇ Tailscale exposure
│ Off

◇ Gateway token source
│ Generate/store plaintext token

◇ Gateway token (blank to generate)
│ 6a27e5710dddasda2219b35894d8d78a4f24
Config overwrite: /root/.openclaw/openclaw.json (sha256 2829efaa7bb43b4f26346d98a3cdf72c0608746bb141eab195e4fd2967a6cda8 -> fb43886a843bceb3d8d68224e3c0e1a6486f82577ebdaec9bf45a869df23cedf, backup=/root/.openclaw/openclaw.json.bak)
Updated ~/.openclaw/openclaw.json

◇ Select sections to configure
│ Continue

└ Configure complete.

配置本地IP访问+允许HTTP

编辑~/.openclaw/openclaw.json

"gateway": {
"port": 8789,
"mode": "local",
"bind": "custom",
"customBindHost": "0.0.0.0",
"controlUi": {
"allowedOrigins": [
"http://localhost:8789",
"http://127.0.0.1:8789",
"http://0.0.0.0:8789",
"http://10.0.4.13:8789" # 新增
],
"dangerouslyAllowHostHeaderOriginFallback": true, # 新增
"allowInsecureAuth": true, # 新增
"dangerouslyDisableDeviceAuth": true # 新增
},

配置后重启服务

# 停止服务
[root@VM-4-13-opencloudos ~]# openclaw gateway stop

# 清理残留元数据
[root@VM-4-13-opencloudos ~]# openclaw gateway install --force

Installed systemd service: /root/.config/systemd/user/openclaw-gateway.service
Previous unit backed up to: /root/.config/systemd/user/openclaw-gateway.service.bak

# 重新启动服务
[root@VM-4-13-opencloudos ~]# openclaw gateway start

Restarted systemd service: openclaw-gateway.service

浏览器验证

使用浏览器打开UI

通过token登陆

参考文档:
https://docs.openclaw.ai/start/getting-started