Updating

Updating

Keep OpenClaw up to date.

The fastest way to update. It detects your install type (npm or git), fetches the latest version, runs openclaw doctor, and restarts the gateway.

​ 最快的更新方式。它会检测你的安装类型(npm 或 git),获取最新版本,运行 openclaw doctor 并重启网关。

1
openclaw update

To switch channels or target a specific version:

​ 要切换渠道或指定特定版本:

1
2
3
openclaw update --channel beta
openclaw update --tag main
openclaw update --dry-run   # preview without applying

See Development channels for channel semantics.

​ 有关版本通道的含义,请参阅Development channels

Alternative: re-run the installer 另一种方式:重新运行安装程序

1
curl -fsSL https://openclaw.ai/install.sh | bash

Add --no-onboard to skip onboarding. For source installs, pass --install-method git --no-onboard.

​ 添加 --no-onboard 可跳过初始设置。对于源码安装,请传递 --install-method git --no-onboard

即:

1
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard

1
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --install-method git --no-onboard

在Windows上的相关命令如下:

1
irm https://openclaw.ai/install.ps1 | iex -Args --no-onboard

1
irm https://openclaw.ai/install.ps1 | iex -Args --install-method,git,--no-onboard

Alternative: manual npm or pnpm 替代方案:手动使用 npm 或 pnpm

1
npm i -g openclaw@latest
1
pnpm add -g openclaw@latest

Auto-updater

The auto-updater is off by default. Enable it in ~/.openclaw/openclaw.json:

​ 自动更新程序默认处于关闭状态。请在 ~/.openclaw/openclaw.json 中启用它:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
  update: {
    channel: "stable",
    auto: {
      enabled: true,
      stableDelayHours: 6,
      stableJitterHours: 12,
      betaCheckIntervalHours: 1,
    },
  },
}
ChannelBehavior
stableWaits stableDelayHours, then applies with deterministic jitter across stableJitterHours (spread rollout). 等待stableDelayHours,然后在stableJitterHours范围内应用确定性抖动(分批发布)。
betaChecks every betaCheckIntervalHours (default: hourly) and applies immediately. 每betaCheckIntervalHours(默认:每小时)检查一次并立即应用。
devNo automatic apply. Use openclaw update manually. 无自动应用。请手动使用 openclaw update

The gateway also logs an update hint on startup (disable with update.checkOnStart: false).

​ gateway 在启动时还会记录更新提示(可通过 update.checkOnStart: false 禁用)。

After updating

  1. Run doctor

    1
    
    openclaw doctor
    
  2. Migrates config, audits DM policies, and checks gateway health. Details: Doctor

    迁移配置、审核私信策略并检查网关健康状态。详情:Doctor

  3. Restart the gateway

    1
    
    openclaw gateway restart
    
  4. Verify

    1
    
    openclaw health
    

Rollback 回滚

Pin a version (npm) 固定版本(npm)

1
2
3
npm i -g openclaw@<version>
openclaw doctor
openclaw gateway restart

Tip: npm view openclaw version shows the current published version.

​ 提示:npm view openclaw version 会显示当前已发布的版本。

Pin a commit (source) 固定提交(源代码)

1
2
3
4
git fetch origin
git checkout "$(git rev-list -n 1 --before=\"2026-01-01\" origin/main)"
pnpm install && pnpm build
openclaw gateway restart

To return to latest: git checkout main && git pull.

​ 回到最新版本:git checkout main && git pull

If you are stuck 遇到问题时

最后修改 April 3, 2026: 更新 openclaw 教程 (5f29e28)