Files
openclaw/docs/install/uninstall.md

126 lines
3.2 KiB
Markdown
Raw Normal View History

2026-01-11 10:23:52 +00:00
---
2026-01-30 03:15:10 +01:00
summary: "Uninstall OpenClaw completely (CLI, service, state, workspace)"
2026-01-11 10:23:52 +00:00
read_when:
2026-01-30 03:15:10 +01:00
- You want to remove OpenClaw from a machine
2026-01-11 10:23:52 +00:00
- The gateway service is still running after uninstall
---
# Uninstall
Two paths:
2026-01-30 03:15:10 +01:00
- **Easy path** if `openclaw` is still installed.
2026-01-11 10:23:52 +00:00
- **Manual service removal** if the CLI is gone but the service is still running.
## Easy path (CLI still installed)
Recommended: use the built-in uninstaller:
```bash
2026-01-30 03:15:10 +01:00
openclaw uninstall
2026-01-11 10:23:52 +00:00
```
Non-interactive (automation / npx):
```bash
2026-01-30 03:15:10 +01:00
openclaw uninstall --all --yes --non-interactive
npx -y openclaw uninstall --all --yes --non-interactive
2026-01-11 10:23:52 +00:00
```
Manual steps (same result):
1) Stop the gateway service:
```bash
2026-01-30 03:15:10 +01:00
openclaw gateway stop
2026-01-11 10:23:52 +00:00
```
2) Uninstall the gateway service (launchd/systemd/schtasks):
```bash
2026-01-30 03:15:10 +01:00
openclaw gateway uninstall
2026-01-11 10:23:52 +00:00
```
3) Delete state + config:
```bash
2026-01-30 03:15:10 +01:00
rm -rf "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}"
2026-01-11 10:23:52 +00:00
```
2026-01-30 03:15:10 +01:00
If you set `OPENCLAW_CONFIG_PATH` to a custom location outside the state dir, delete that file too.
2026-01-11 10:23:52 +00:00
4) Delete your workspace (optional, removes agent files):
```bash
2026-01-30 03:15:10 +01:00
rm -rf ~/.openclaw/workspace
2026-01-11 10:23:52 +00:00
```
5) Remove the CLI install (pick the one you used):
```bash
2026-01-30 03:15:10 +01:00
npm rm -g openclaw
pnpm remove -g openclaw
bun remove -g openclaw
2026-01-11 10:23:52 +00:00
```
6) If you installed the macOS app:
```bash
2026-01-30 03:15:10 +01:00
rm -rf /Applications/OpenClaw.app
2026-01-11 10:23:52 +00:00
```
Notes:
2026-01-30 03:15:10 +01:00
- If you used profiles (`--profile` / `OPENCLAW_PROFILE`), repeat step 3 for each state dir (defaults are `~/.openclaw-<profile>`).
2026-01-11 10:23:52 +00:00
- In remote mode, the state dir lives on the **gateway host**, so run steps 1-4 there too.
## Manual service removal (CLI not installed)
2026-01-30 03:15:10 +01:00
Use this if the gateway service keeps running but `openclaw` is missing.
2026-01-11 10:23:52 +00:00
### macOS (launchd)
2026-01-30 03:15:10 +01:00
Default label is `bot.molt.gateway` (or `bot.molt.<profile>`; legacy `com.openclaw.*` may still exist):
2026-01-11 10:23:52 +00:00
```bash
launchctl bootout gui/$UID/bot.molt.gateway
rm -f ~/Library/LaunchAgents/bot.molt.gateway.plist
2026-01-11 10:23:52 +00:00
```
2026-01-30 03:15:10 +01:00
If you used a profile, replace the label and plist name with `bot.molt.<profile>`. Remove any legacy `com.openclaw.*` plists if present.
2026-01-11 10:23:52 +00:00
### Linux (systemd user unit)
2026-01-30 03:15:10 +01:00
Default unit name is `openclaw-gateway.service` (or `openclaw-gateway-<profile>.service`):
2026-01-11 10:23:52 +00:00
```bash
2026-01-30 03:15:10 +01:00
systemctl --user disable --now openclaw-gateway.service
rm -f ~/.config/systemd/user/openclaw-gateway.service
2026-01-11 10:23:52 +00:00
systemctl --user daemon-reload
```
### Windows (Scheduled Task)
2026-01-30 03:15:10 +01:00
Default task name is `OpenClaw Gateway` (or `OpenClaw Gateway (<profile>)`).
2026-01-11 10:23:52 +00:00
The task script lives under your state dir.
```powershell
2026-01-30 03:15:10 +01:00
schtasks /Delete /F /TN "OpenClaw Gateway"
Remove-Item -Force "$env:USERPROFILE\.openclaw\gateway.cmd"
2026-01-11 10:23:52 +00:00
```
2026-01-30 03:15:10 +01:00
If you used a profile, delete the matching task name and `~\.openclaw-<profile>\gateway.cmd`.
2026-01-11 10:23:52 +00:00
## Normal install vs source checkout
### Normal install (install.sh / npm / pnpm / bun)
2026-01-30 03:15:10 +01:00
If you used `https://openclaw.bot/install.sh` or `install.ps1`, the CLI was installed with `npm install -g openclaw@latest`.
Remove it with `npm rm -g openclaw` (or `pnpm remove -g` / `bun remove -g` if you installed that way).
2026-01-11 10:23:52 +00:00
### Source checkout (git clone)
2026-01-30 03:15:10 +01:00
If you run from a repo checkout (`git clone` + `openclaw ...` / `bun run openclaw ...`):
2026-01-11 10:23:52 +00:00
1) Uninstall the gateway service **before** deleting the repo (use the easy path above or manual service removal).
2) Delete the repo directory.
3) Remove state + workspace as shown above.