How to uninstall OpenClaw (and what to try before you do)
If you searched for how to uninstall OpenClaw, this page walks through a complete removal on macOS, Linux, and Windows, for npm installs, the hosted installer script, Docker, and a git checkout. A short note at the end covers the case where you came here because setup failed, not because you want agents gone for good.
Save your data first
Uninstalling can take your data with it, and there is no undo. OpenClaw keeps config, sessions, credentials, and the agent workspace under a state directory in your home folder (by default ~/.openclaw, overridable with OPENCLAW_STATE_DIR). That tree holds openclaw.json, channel tokens on disk, saved sessions, installed skills, and workspace files such as memory and daily notes.
Copy it before you delete anything:
cp -r ~/.openclaw ~/openclaw-backup
On Windows, copy %USERPROFILE%\.openclaw to another folder. If you used a profile (--profile or OPENCLAW_PROFILE), you may also have ~/.openclaw-<name>; back those up the same way. For Docker, data lives in the volume you mounted, not inside the container image, so back up that volume path or export the volume before you remove it.
The CLI can snapshot state before a reset: openclaw backup create (see the reset command docs). That is worth running if you might reinstall and want a restorable copy.
Stop the agent first
Removing files while the gateway is running risks corrupted sessions and a service that immediately tries to restart. Stop OpenClaw before you uninstall packages or delete directories.
If the CLI is still on your PATH, the direct stop is:
openclaw gateway stop
If you installed a background daemon (for example via openclaw onboard --install-daemon from the install guide), the gateway also runs as a system service. Stopping the CLI is not always enough until you unload that service, which the next sections cover.
For a quick pause without teardown, stopping the gateway leaves config and workspace intact so you can start again later.
Use the built in uninstaller
OpenClaw ships an uninstall flow in the CLI. The official uninstall doc treats this as the recommended path when openclaw still runs.
Interactive:
openclaw uninstall
Non interactive (scripts, remote SSH, or you already know you want everything gone):
openclaw uninstall --all --yes --non-interactive
If the binary is missing but you still have npm, you can run the same through npx:
npx -y openclaw uninstall --all --yes --non-interactive
That sequence is meant to stop the gateway, remove the gateway service registration, and prompt you (or, with --all --yes, proceed) through state and workspace cleanup. After it finishes, remove the global package with the tool you used to install:
npm rm -g openclaw
(or pnpm remove -g openclaw / bun remove -g openclaw).
Manual equivalent if you prefer explicit steps: openclaw gateway stop, then openclaw gateway uninstall, then delete state (below), then npm rm -g openclaw.
Remove the background service by hand
When the CLI is gone but something still respawns the gateway, remove the service definition for your OS. Default names come from the uninstall documentation; profile installs use a suffix on the label or unit name.
macOS (launchd user agent). Default label ai.openclaw.gateway (legacy installs may still use com.openclaw.*):
launchctl bootout gui/$UID/ai.openclaw.gateway
rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Apple documents launchd job layout in the Creating Launch Daemons and Agents archive guide.
Linux (systemd user unit). Default unit openclaw-gateway.service:
systemctl --user disable --now openclaw-gateway.service
rm -f ~/.config/systemd/user/openclaw-gateway.service
systemctl --user daemon-reload
See the systemctl manual for user level units.
Windows (scheduled task). Default task name OpenClaw Gateway:
schtasks /Delete /F /TN "OpenClaw Gateway"
Remove-Item -Force "$env:USERPROFILE\.openclaw\gateway.cmd" -ErrorAction SilentlyContinue
If you only ever started OpenClaw in a terminal and never installed the daemon, skip service removal.
Remove the npm (or pnpm / bun) package
The install.sh and PowerShell installer put the CLI on your machine with npm install -g openclaw@latest. Remove it with:
npm rm -g openclaw
Confirm the binary is gone:
which openclaw
On Windows, use where openclaw. No output means PATH no longer resolves the command. Open a new terminal if an old session still finds a cached path.
If the command still resolves, you likely have multiple Node installs (Homebrew Node, system Node, nvm, fnm, volta). Run which -a openclaw on Unix, uninstall openclaw on each Node version that had it, and check npm prefix -g plus echo "$PATH" against the install troubleshooting section so the global bin directory matches the Node you use day to day.
Permission errors. npm rm -g openclaw failing with EACCES usually means global modules live in a root owned directory. Fixing the npm global directory permissions is safer than making every global uninstall require sudo. The npm uninstall command reference documents flags if you need them.
macOS app bundle. Some installs also place /Applications/OpenClaw.app. Remove it with:
rm -rf /Applications/OpenClaw.app
Delete the state directory
Uninstalling the package removes the program, not the directories it wrote. Delete the state dir after backup:
rm -rf "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}"
If you set OPENCLAW_CONFIG_PATH outside that tree, remove that file or folder too (echo $OPENCLAW_CONFIG_PATH on Unix, $env:OPENCLAW_CONFIG_PATH in PowerShell).
Older rebrands sometimes left data in ~/.clawdbot or ~/.moltbot. If you migrated from an early name, check those paths and delete them if they still exist.
Clear API keys and channel tokens you exported into shell profiles or a secrets manager. Those values often live outside .openclaw in environment variables you set during onboarding.
Docker installs
Container teardown follows Docker semantics. List what you actually created:
docker ps -a
docker volume ls
Stop and remove the container (names vary with your compose file or run command):
docker stop openclaw
docker rm openclaw
The docker container rm reference covers force remove and linked containers. Removing the container does not remove a named volume that held /data or your mount.
Remove the image when you no longer need it:
docker rmi openclaw
Removing the volume is what deletes agent data permanently:
docker volume rm openclaw_data
See docker volume rm. Substitute your real container, image, and volume names from docker ps -a and docker volume ls.
Git clone / source checkout
If you run from a cloned openclaw/openclaw repo (bun run openclaw or similar), uninstall the gateway service first (built in uninstaller or manual service steps above), delete the repository directory, then remove state and workspace the same way as an npm install. There is no global openclaw package to npm rm unless you also installed the CLI globally.
Reset without removing the CLI
When the problem is bad config or corrupted sessions, not the install itself, use openclaw reset instead of a full uninstall:
openclaw reset --dry-run
openclaw reset --scope config+creds+sessions --yes --non-interactive
Scopes include config, config+creds+sessions, and full. That wipes local state while keeping the CLI installed, which is faster than reinstalling Node packages when you only need a clean openclaw.json and fresh sessions.
Uninstall troubleshooting
| Situation | What to do |
|---|---|
| CLI missing but gateway still running | Use manual service removal for your OS, then delete state. On macOS you can also pkill -f "openclaw gateway" before removing the launchd plist |
npm says package not found but openclaw runs | Reinstall once on the same Node, run openclaw uninstall --all --yes --non-interactive, then npm rm -g openclaw, or delete the shim path which openclaw prints and remove state by hand |
| Stale global bin after an update | A temporary .openclaw-* shim can linger while the real openclaw link disappears. Reinstalling openclaw@latest globally or running the built in uninstaller clears it; see issue #63719 for context |
| Remote gateway | State lives on the gateway host, so run stop, service uninstall, and directory deletion there, not only on your laptop |
| Starting over with the same memory | Uninstall or reset, remove .openclaw, reinstall from the install docs, then copy backed up workspace files into the new workspace directory |
Before you uninstall
Many searches that land on uninstall guides follow install failures, gateway errors, or pairing that never completed. If that matches you, the agent idea may still be fine while the self hosted operations (Node versions, daemon restarts, port conflicts) were the friction.
Operator.io runs OpenClaw as a managed service: no global npm install, no launchd plist to debug, and channels such as Telegram or Discord attach from the dashboard. You get the same agent model and tool patterns without maintaining the gateway process on your own hardware. See pricing if you want to try that path instead of another evening fighting openclaw gateway stop.
If you are done running an agent locally for now, the finish line looks like this:
- Gateway stopped
- Service definition removed
- CLI package removed with
npm rm -g(or the pnpm/bun equivalent) - State directory deleted, plus any custom
OPENCLAW_CONFIG_PATHor profile dirs - Docker volumes removed if you used containers
After that, which openclaw returns nothing and ~/.openclaw is gone, and OpenClaw leaves no running process behind.
Frequently asked questions
How do I uninstall OpenClaw?
+
Stop the gateway first so nothing is writing to disk. If the CLI still works, run openclaw uninstall or openclaw uninstall --all --yes --non-interactive, then remove the global package with npm rm -g openclaw (or pnpm remove -g / bun remove -g if you used those). Delete the state directory with rm -rf "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}". For Docker, stop and remove the container, then remove the volume that held data. Back up the workspace folder before you delete anything.
Does uninstalling OpenClaw delete my data?
+
Removing the npm package alone leaves your data on disk. Deleting the state directory (usually ~/.openclaw on macOS and Linux, or %USERPROFILE%\.openclaw on Windows) removes config, sessions, credentials, and the workspace where memory files and notes live. Docker data sits in the mounted volume, not the container, so docker volume rm is what erases it. Copy the folder somewhere safe first if you might want those files later.
How do I stop OpenClaw without uninstalling it?
+
Run openclaw gateway stop if the CLI is available, or stop the background service through launchd on macOS, systemd on Linux, or the scheduled task on Windows. That halts the gateway without removing config. For a broken install you want to keep the CLI but wipe bad state, use openclaw reset with a scope like config or config+creds+sessions instead of a full uninstall.
npm uninstall openclaw is not working, what do I do?
+
If npm says the package is not found, OpenClaw may be installed under a different Node version or user. Run which openclaw (or where openclaw on Windows), then npm ls -g openclaw on the Node that owns that path. With nvm or fnm, switch to the version you used for install and run npm rm -g openclaw there. If the binary survives, delete the file which points to and remove the state directory by hand. Permission errors (EACCES) mean fixing your global npm prefix rather than forcing sudo on every command.
Keep reading
How to set up OpenClaw on Discord, step by step
Create a bot in the Discord Developer Portal, turn on the Message Content Intent, invite it with the right scopes, drop the token and application ID into your config, then approve the DM pairing code, including the intent toggle that leaves most bots online but silent.
May 31, 2026Debugging the OpenAI Codex backend in OpenClaw
Running OpenClaw on your ChatGPT Codex subscription is popular and currently the most bug-prone backend. Turn completion stalls, Cloudflare 403s misread as auth failures, OAuth 401s after a clean login, and timeouts waiting for turn/completed are all live. Here is what is going on.
May 30, 2026Debugging OpenClaw on Discord: application IDs, intents, and double messages
Most OpenClaw Discord problems are one of a few things: the app ID never resolves, the bot cannot read messages because the intent is off, the gateway hangs at awaiting readiness, or replies arrive twice. Here is how to tell which and fix it.
May 30, 2026