Remote Gateway README 远程网关部署
远程网关允许在独立服务器上部署网关服务。
使用场景
- 需要公网访问
- 高性能需求
- 多客户端共享
- 隔离部署
快速开始
1. 安装
bash
# 在服务器上安装
curl -sL https://molt.bot/install | bash -s gateway
# 或通过 npm
npm install -g @openclaw/gateway2. 配置
bash
# 初始化配置
openclaw gateway init
# 编辑配置
openclaw gateway configure3. 启动
bash
# 前台启动
openclaw gateway start
# 后台启动
openclaw gateway start --background
# 使用 systemd
sudo systemctl enable openclaw-gateway
sudo systemctl start openclaw-gateway配置示例
yaml
gateway:
host: "0.0.0.0"
port: 8211
tls:
enabled: true
cert: "/etc/openclaw/cert.pem"
key: "/etc/openclaw/key.pem"
authentication:
type: "token"
token: "${GATEWAY_TOKEN}"
cors:
enabled: true
origins:
- "https://your-domain.com"Docker 部署
yaml
version: '3.8'
services:
openclaw-gateway:
image: openclaw/gateway:latest
ports:
- "8211:8211"
environment:
- GATEWAY_TOKEN=${GATEWAY_TOKEN}
- GATEWAY_TLS_ENABLED=true
volumes:
- ./data:/data
- ./logs:/var/log/openclaw
restart: unless-stopped安全考虑
- 使用 TLS: 必须启用 HTTPS/WSS
- 强认证: 使用强随机 Token
- 防火墙: 只开放必要端口
- 监控: 启用日志和监控