🦞 OpenClaw 文档中心

Gateway自启配置

创建systemd service文件

cat > /etc/systemd/system/openclaw-gateway.service << 'SERVICE'
[Unit]
Description=OpenClaw Gateway
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=/root
ExecStart=/root/.nvm/versions/node/v22.22.0/bin/openclaw gateway
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
SERVICE

启用自启

systemctl daemon-reload
systemctl enable openclaw-gateway
systemctl start openclaw-gateway
systemctl status openclaw-gateway

管理Gateway

systemctl restart openclaw-gateway  # 重启
systemctl stop openclaw-gateway     # 停止
journalctl -u openclaw-gateway -f   # 查看日志