openclaw/docs/install/updating.md

129 lines
2.9 KiB
Markdown
Raw Normal View History

2026-01-06 19:24:33 +01:00
---
2026-01-30 03:15:10 +01:00
summary: "Updating OpenClaw safely (global install or source), plus rollback strategy"
2026-01-06 19:24:33 +01:00
read_when:
2026-01-30 03:15:10 +01:00
- Updating OpenClaw
2026-01-06 19:24:33 +01:00
- Something breaks after an update
title: "Updating"
2026-01-06 19:24:33 +01:00
---
# Updating
Keep OpenClaw up to date.
2026-01-06 19:24:33 +01:00
## Recommended: `openclaw update`
2026-01-13 07:58:47 +00:00
The fastest way to update. It detects your install type (npm or git), fetches the latest version, runs `openclaw doctor`, and restarts the gateway.
2026-01-13 07:58:47 +00:00
```bash
openclaw update
2026-01-06 19:24:33 +01:00
```
2026-01-31 21:13:13 +09:00
To switch channels or target a specific version:
2026-01-17 11:40:02 +00:00
```bash
2026-01-30 03:15:10 +01:00
openclaw update --channel beta
openclaw update --tag main
openclaw update --dry-run # preview without applying
2026-01-17 11:40:02 +00:00
```
See [Development channels](/install/development-channels) for channel semantics.
## Alternative: re-run the installer
```bash
curl -fsSL https://openclaw.ai/install.sh | bash
```
Add `--no-onboard` to skip onboarding. For source installs, pass `--install-method git --no-onboard`.
## Alternative: manual npm or pnpm
```bash
npm i -g openclaw@latest
```
```bash
pnpm add -g openclaw@latest
```
## Auto-updater
2026-01-20 13:33:31 +00:00
The auto-updater is off by default. Enable it in `~/.openclaw/openclaw.json`:
```json5
{
update: {
channel: "stable",
auto: {
enabled: true,
stableDelayHours: 6,
stableJitterHours: 12,
betaCheckIntervalHours: 1,
},
},
}
```
| Channel | Behavior |
| -------- | ------------------------------------------------------------------------------------------------------------- |
| `stable` | Waits `stableDelayHours`, then applies with deterministic jitter across `stableJitterHours` (spread rollout). |
| `beta` | Checks every `betaCheckIntervalHours` (default: hourly) and applies immediately. |
| `dev` | No automatic apply. Use `openclaw update` manually. |
The gateway also logs an update hint on startup (disable with `update.checkOnStart: false`).
## After updating
<Steps>
2026-01-06 19:24:33 +01:00
### Run doctor
2026-01-10 20:32:19 +01:00
```bash
2026-01-30 03:15:10 +01:00
openclaw doctor
2026-01-06 19:24:33 +01:00
```
Migrates config, audits DM policies, and checks gateway health. Details: [Doctor](/gateway/doctor)
2026-01-31 21:13:13 +09:00
### Restart the gateway
2026-01-06 19:24:33 +01:00
```bash
2026-01-30 03:15:10 +01:00
openclaw gateway restart
2026-01-06 19:24:33 +01:00
```
### Verify
2026-01-06 19:24:33 +01:00
```bash
openclaw health
2026-01-06 19:24:33 +01:00
```
</Steps>
2026-01-10 21:14:30 +01:00
## Rollback
2026-01-11 04:46:26 +01:00
### Pin a version (npm)
2026-01-06 19:24:33 +01:00
```bash
npm i -g openclaw@<version>
2026-01-30 03:15:10 +01:00
openclaw doctor
openclaw gateway restart
2026-01-06 19:24:33 +01:00
```
Tip: `npm view openclaw version` shows the current published version.
2026-01-06 19:24:33 +01:00
### Pin a commit (source)
2026-01-06 19:24:33 +01:00
```bash
git fetch origin
git checkout "$(git rev-list -n 1 --before=\"2026-01-01\" origin/main)"
pnpm install && pnpm build
2026-01-30 03:15:10 +01:00
openclaw gateway restart
2026-01-06 19:24:33 +01:00
```
To return to latest: `git checkout main && git pull`.
2026-01-06 19:24:33 +01:00
## If you are stuck
2026-01-06 19:24:33 +01:00
- Run `openclaw doctor` again and read the output carefully.
2026-01-07 02:04:02 +01:00
- Check: [Troubleshooting](/gateway/troubleshooting)
- Ask in Discord: [https://discord.gg/clawd](https://discord.gg/clawd)