跳转到内容

Linux 应用 (Linux App)

网关在 Linux 上得到完全支持。推荐使用 Node 作为运行时。 不推荐将 Bun 用于网关(存在 WhatsApp/Telegram bug)。

计划推出原生 Linux 配套应用。如果您想帮助构建一个,欢迎贡献。

  1. 安装 Node 22+
  2. npm i -g openclaw@latest
  3. openclaw onboard --install-daemon
  4. 从您的笔记本电脑:ssh -N -L 18789:127.0.0.1:18789 <user>@<host>
  5. 打开 http://127.0.0.1:18789/ 并粘贴您的令牌

使用以下命令之一:

Terminal window
openclaw onboard --install-daemon

或者:

Terminal window
openclaw gateway install

或者:

Terminal window
openclaw configure

在提示时选择 Gateway service

修复/迁移:

Terminal window
openclaw doctor

OpenClaw 默认安装 systemd 用户服务。对于共享或始终在线的服务器,请使用 system 服务。完整的单元示例和指南位于 网关运行手册 中。

最小设置:

创建 ~/.config/systemd/user/openclaw-gateway[-<profile>].service

[Unit]
Description=OpenClaw Gateway (profile: <profile>, v<version>)
After=network-online.target
Wants=network-online.target
[Service]
ExecStart=/usr/local/bin/openclaw gateway --port 18789
Restart=always
RestartSec=5
[Install]
WantedBy=default.target

启用它:

Terminal window
systemctl --user enable --now openclaw-gateway[-<profile>].service