更新升级
保持 OpenClaw 更新以获得最新功能与安全修复。
最简方式:重新运行安装脚本
安装脚本是幂等的(Idempotent),重新运行会自动检测并升级到最新版本:
bash
curl -fsSL https://openclaw.ai/install.sh | bashpowershell
iwr -useb https://openclaw.ai/install.ps1 | iex更新前检查清单
在更新之前,建议完成以下检查:
- [ ] 查看 更新日志 了解新版本变化
- [ ] 备份配置文件:
cp -r ~/.openclaw/config ~/.openclaw/config.bak - [ ] 确认当前没有正在运行的关键任务
- [ ] 记录当前版本号:
openclaw --version
更新方法
方法一:全局包管理器更新
bash
npm update -g openclawbash
pnpm update -g openclaw方法二:从源码更新
bash
cd /path/to/openclaw
git pull origin main
pnpm install
pnpm build
pnpm link --global方法三:CLI 自带更新命令
bash
openclaw update该命令会自动检测当前安装方式并执行对应的更新流程。
方法四:Control UI(控制面板)更新
- 打开 OpenClaw 控制面板
- 进入 设置 > 系统 > 更新
- 如有新版本,点击 立即更新
更新后验证
bash
# 检查版本
openclaw --version
# 健康检查
openclaw doctor
# 重启服务
openclaw restart启动 / 停止 / 重启
bash
# 启动 Gateway
openclaw start
# 停止
openclaw stop
# 重启
openclaw restart
# 查看状态
openclaw status回滚到旧版本
如果新版本出现问题,可以回退到指定版本:
npm / pnpm 回滚
bash
# 安装指定版本
npm install -g openclaw@1.2.3
# 查看所有可用版本
npm view openclaw versions --json安装脚本回滚
bash
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --version 1.2.3源码回滚
bash
cd /path/to/openclaw
git checkout v1.2.3
pnpm install
pnpm build版本锁定(Pinning)
如果你不希望自动更新,可以锁定当前版本:
bash
# 禁用自动更新检查
openclaw config set auto_update false
# 或在配置文件中设置
# ~/.openclaw/config/gateway.yaml
# updates:
# auto_check: false🇨🇳 中国用户须知
使用国内镜像加速更新:
bash
# npm 镜像
npm update -g openclaw --registry=https://registry.npmmirror.com
# 安装脚本镜像
curl -fsSL https://openclaw.ai/install.sh | bash