Gateway 配置
配置 OpenClaw Gateway — 所有渠道和 Agent 的中央路由中枢。
概述
Gateway 是 OpenClaw 的核心组件。它管理所有渠道连接、将消息路由到 Agent,并处理会话管理。
启动 Gateway
# 作为后台守护进程启动
openclaw gateway --daemon
# 前台启动(用于调试)
openclaw gateway --port 18789配置
Gateway 在 ~/.openclaw/openclaw.json 中配置:
{
"gateway": {
"port": 18789,
"host": "127.0.0.1",
"logLevel": "info"
}
}关键选项
| 选项 | 说明 | 默认值 |
|---|---|---|
port | 控制面板和 API 的 HTTP 端口 | 18789 |
host | 绑定地址 | 127.0.0.1 |
logLevel | 日志级别(debug, info, warn, error) | info |
Gateway 管理
# 检查状态
openclaw gateway status
# 停止守护进程
openclaw service stop
# 重启
openclaw service restart
# 查看日志
openclaw logs --follow远程访问
通过 Tailscale
{
"gateway": {
"host": "0.0.0.0",
"tailscale": true
}
}通过 SSH 隧道
ssh -L 18789:localhost:18789 user@remote-server控制面板
openclaw dashboard