本文概览
适用于通过 npm 或 git 安装 OpenClaw 的用户,介绍两种升级方式、升级后检查与重启步骤,以及回滚方法。关键步骤包括:
- 使用
openclaw update 进行快速升级 - 若升级失败,使用官方安装脚本重新安装
- 完成后运行
openclaw doctor、重启网关并验证健康状态 - 需要时回滚到指定版本
推荐
最快的更新方式。它会检测你的安装类型(npm 或 git)、获取最新版本、运行 openclaw doctor,并重启 Gateway 网关。
1
2
3
4
5
6
7
8
9
10
11
| # 推荐升级方式
# 检测安装类型、拉取最新版本、执行健康检测并重启网关
openclaw update
# 指定更新渠道或标签
openclaw update --channel beta
openclaw update --channel dev
openclaw update --tag main
openclaw update --dry-run # 预览而不实际应用
openclaw config set update.channel stable #更新升级版本通道
openclaw restart
|
版本通道通过 update.channel 配置,可选值:
- stable — 稳定版,推荐生产环境
- beta — 测试版(你当前用的)
- dev — 开发版,最新但最不稳定
替代方式
通过重新运行安装脚本完成升级或恢复。
1
2
| # 基本安装脚本
curl -fsSL https://openclaw.ai/install.sh | bash
|
- 添加
--no-onboard 可跳过新手引导。 - 强制指定安装类型:
1
2
| curl -fsSL https://openclaw.ai/install.sh | bash -s -- --install-method git --no-onboard
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --install-method npm --no-onboard
|
1
| curl -fsSL https://openclaw.ai/install.sh | bash -s -- --install-method npm --version <version-or-dist-tag>
|
若 openclaw update 在 npm 软件包安装阶段后失败,重新运行上述安装器即可。安装器不会调用旧的更新器,而是直接执行全局软件包安装,能够恢复部分更新的 npm 安装。
更新后
执行健康检查、重启网关并验证系统状态。
1
2
3
4
5
6
7
8
9
| # 运行 Doctor
openclaw doctor
openclaw doctor --fix
# 重启 Gateway
openclaw gateway restart
# 验证健康状态
openclaw health
|
回滚
固定到特定版本(npm)时使用以下命令:
1
2
3
4
5
6
7
8
9
10
11
| npm i -g openclaw@<version>
openclaw doctor
openclaw gateway restart
# 回退记录
npm i -g [email protected]
# 回退版本后需要修改 openclaw.json 的 lastTouchedVersi为你回退的版本
"meta": {
"lastTouchedVersion": "2026.5.16-beta.1",
"lastTouchedAt": "2026-05-17T06:14:56.490Z"
}
|
常用命令
1
2
3
4
5
6
7
8
9
10
11
|
# 停止
systemctl --user stop openclaw-gateway.service
nano ~/.config/systemd/user/openclaw-gateway.service
# 检查进程
ps -ef | grep gateway
lsof -i :18789
grep -R "openclaw" -n ~/.config/systemd/user
ls -R ~/.config/systemd/user | grep -i openclaw
find ~/.config/systemd/user -iname "*openclaw*"
find ~ -maxdepth 3 -iname "*openclaw*"
|
官方手册