🧰 Tooling Guide

How to Uninstall OpenClaw Completely: Dry Runs, the CLI That Stays Behind, and the Leftovers rm -rf Misses

•6 min read

openclaw uninstall leaves the openclaw command installed. It removes the Gateway service and whichever data you pick, and the CLI has to go through your package manager afterward.

The uninstall guides that rank for this run between roughly 2,100 and 3,500 words. All of them stop the Gateway, remove the background service, run npm rm -g openclaw, and delete ~/.openclaw, and that order is correct. Two of the three I read never mention --dry-run. None of them use the backup command's own dry run as a map of what is actually on your disk, and that map is how you find the config file, credentials folder, or second profile that a plain rm -rf ~/.openclaw walks right past.

Decide how much you are removing

The agent should stop running, but keep everything

openclaw gateway stop --disable. On macOS a plain stop doesn't survive a reboot.

No autostart service, config and agents untouched

openclaw gateway uninstall.

Start over on the same machine

openclaw reset, which keeps the CLI. The setup vs onboard vs configure guide covers its scopes.

One plugin is the problem

openclaw plugins uninstall <plugin-id>, explained in the plugins guide.

OpenClaw gone from this machine

Everything below, in order.

My honest read is that most people typing "uninstall OpenClaw" into a search bar want the third box. Something broke during setup, they want a clean slate, and a full uninstall followed by a reinstall costs them a download and a fresh openclaw onboard for nothing.

Back up first, and use the dry run as your map

openclaw backup create --dry-run --json
openclaw backup create --verify --output ~/Backups

The dry run lists the paths a backup would take. That means the state directory (usually ~/.openclaw), the active config file, a credentials/ directory if it lives outside the state directory, and every workspace your current config points to. Paths already inside the state directory aren't listed twice. Read that list before you delete anything. Anything on it outside ~/.openclaw is something the manual rm -rf step will not touch.

Pass --output. The default is a timestamped .tar.gz in whatever directory you happen to be standing in, which is a bad place for the one file you need after an uninstall. OpenClaw refuses output paths inside the state or workspace trees and never overwrites an existing archive, so the archive can't eat itself, but it can still land somewhere you forget about. --verify checks the manifest and every payload right after writing.

If your config is broken (often the reason you're here), backup create fails fast while workspace backup is on. Rerun with --no-include-workspace and copy the workspace folder by hand. The backup and migration guide has the restore side.

Preview, then run the uninstaller

openclaw uninstall --dry-run --all
openclaw uninstall

With no scope flags you get a multiselect with four choices: service, state, workspace, and app (the macOS app). The first three come preselected. Watch the workspace box. --state removes state and config but keeps your configured workspace directories unless --workspace is also selected, which is the right default and also the reason ~/.openclaw/workspace can still be sitting there, SOUL.md and all, a month after you "removed everything."

openclaw uninstall --all --yes --non-interactive
npx -y openclaw uninstall --all --yes --non-interactive

--non-interactive requires --yes. I wouldn't type this pair by hand, ever. It belongs in the teardown script for a VPS you are about to destroy anyway. The npx form works when the global CLI is already gone but npm is still on the machine.

Then remove the CLI

npm rm -g openclaw
pnpm remove -g openclaw
bun remove -g openclaw

Run the one matching how you installed. If you used https://openclaw.ai/install.sh or install.ps1, that was npm install -g openclaw@latest under the hood, so npm it is. From a source checkout, uninstall the Gateway service before you delete the repo; the docs are explicit about that order. If you left app unticked, delete /Applications/OpenClaw.app yourself.

Leftovers the default run can't see

Every one of these is a path or service name that a single uninstall pass with default settings never looks at.

Profiles

Each --profile <name> gets its own state directory, ~/.openclaw-<name>, and its own service: ai.openclaw.<name> under launchd, openclaw-gateway-<name>.service under systemd, and a Scheduled Task called OpenClaw Gateway (<name>) on Windows. Run the uninstaller once per profile, dry run first:

openclaw --profile work uninstall --dry-run --all
openclaw --profile work uninstall --all

Custom paths

If you ever set OPENCLAW_STATE_DIR or OPENCLAW_CONFIG_PATH, the manual delete is rm -rf "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}", and a config file kept outside the state dir has to be deleted separately. This is the case the backup dry run catches, since it prints the active config path whatever it is.

Remote mode

If your CLI talks to a Gateway on another box, the state directory lives on the gateway host. Uninstalling on your laptop removes a client. Do the service, state, and workspace steps on the host too.

Windows

The Scheduled Task launches a windowless gateway.vbs in your state directory, which runs gateway.cmd. Both files need to go.

The CLI is gone and the Gateway is still running

This is what you get from running npm rm -g openclaw first. The service doesn't care that the command is gone, and a channel bot can keep replying to messages after you thought OpenClaw was off the machine. Remove the service by hand:

# macOS (launchd)
launchctl bootout gui/$UID/ai.openclaw.gateway
rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist

# Linux (systemd user unit)
systemctl --user disable --now openclaw-gateway.service
rm -f ~/.config/systemd/user/openclaw-gateway.service
systemctl --user daemon-reload

# Windows (PowerShell)
schtasks /Delete /F /TN "OpenClaw Gateway"
Remove-Item -Force "$env:USERPROFILE\.openclaw\gateway.cmd" -ErrorAction SilentlyContinue
Remove-Item -Force "$env:USERPROFILE\.openclaw\gateway.vbs" -ErrorAction SilentlyContinue

Swap in the profile names from above if you used profiles. One Linux trap: machines upgraded from very old installs can still carry a pre-rename clawdbot-gateway.service unit. Both openclaw uninstall and openclaw gateway uninstall detect it and remove it, but the manual systemctl commands above won't, so check systemctl --user list-units | grep -i claw before you call it done. On macOS, launchctl list | grep openclaw should come back empty.

Your keys

Deleting ~/.openclaw does nothing to the provider API keys and bot tokens that were in it, and they stay valid wherever they were issued, so rotate them if this machine is changing hands.

Final verdict

Back up with --output, read the backup dry run, preview the uninstall, and then let openclaw uninstall do the work while the CLI still exists to do it. Remove the npm package last. Then go profile by profile and host by host, working through every path the backup dry run printed. If you're reinstalling after all this, the status vs health guide is how you confirm the fresh Gateway is really up.

⚡

Ready to build?

Get the OpenClaw Starter Kit — config templates, 5 production-ready skills, deployment checklist. Go from zero to running in under an hour.

$14 $6.99

Get the Starter Kit →

Also in the OpenClaw store

🗂️
Executive Assistant Config
Buy
Calendar, email, daily briefings on autopilot.
$6.99
🔍
Business Research Pack
Buy
Competitor tracking and market intelligence.
$5.99
⚡
Content Factory Workflow
Buy
Turn 1 post into 30 pieces of content.
$6.99
📬
Sales Outreach Skills
Buy
Automated lead research and personalized outreach.
$5.99

Get the free OpenClaw quickstart guide

Step-by-step setup. Plain English. No jargon.