How to uninstall OpenClaw cleanly (Linux, Windows, and Mac)

How to uninstall OpenClaw cleanly (Linux, Windows, and Mac)

July 23, 20266 minOpenClaw, AI, Tutorial, DevOps, Uninstall

Short answer (60 seconds): if the CLI is still available, run openclaw uninstall --all --yes --non-interactive — that removes the Gateway daemon (LaunchAgent on macOS, systemd user unit on Linux, Scheduled Task on Windows), state dir, workspace, and the macOS app. Then remove the global CLI with npm rm -g openclaw (or pnpm remove -g openclaw / bun remove -g openclaw depending on how you installed it). If the CLI is gone, clean the service manually: launchctl bootout on macOS, systemctl --user disable --now on Linux, schtasks /Delete /TN "OpenClaw Gateway" on Windows. Also remove ~/.openclaw/ (or %USERPROFILE%\.openclaw\) to clean state and config.

OpenClaw uninstalls with one command, but there are three or four known pitfalls depending on the original install method and OS. This guide covers all three paths: easy (CLI present), full manual (CLI present, fine control), and service-only (CLI is gone but the daemon is still running).

Path 1 · Easy with openclaw uninstall (CLI present)

If openclaw --version responds, this is the recommended path. The uninstaller knows where everything is on your system and cleans each scope you ask for.

Safe preview (dry run)

Before touching anything, see what it will remove:

openclaw uninstall --dry-run --all

Prints the list of paths and services without deleting anything. Useful on servers where you want to review before running.

Full non-interactive uninstall

openclaw uninstall --all --yes --non-interactive

Removes everything: service (Gateway daemon), state (config + credentials), workspace (agent files) and (on macOS) the app.

If you want automation via npx (CI, scripts):

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

Individual scope flags

If you want fine control — for example keep the workspace but remove the rest:

FlagWhat it removes
--serviceOnly the Gateway daemon (LaunchAgent / systemd / schtasks)
--stateOnly the state dir (~/.openclaw/ or %USERPROFILE%\.openclaw\)
--workspaceOnly the agent workspace (default: ~/.openclaw/workspace)
--appOnly the macOS app (/Applications/OpenClaw.app)
--allShorthand for all four scopes above

Typical combinations:

# Keep workspace, remove the rest
openclaw uninstall --service --state --app --yes --non-interactive

# Total reset including workspace
openclaw uninstall --all --yes --non-interactive

# Just stop and remove the daemon (keep state for future reinstall)
openclaw uninstall --service --yes --non-interactive

Remove the global CLI

After running the uninstaller, the openclaw binary remains installed via npm/pnpm/bun. To remove it:

# If you installed with npm
npm rm -g openclaw

# If you installed with pnpm
pnpm remove -g openclaw

# If you installed with bun
bun remove -g openclaw

If you installed with the official installer (install.sh / install.ps1), the CLI lives at ~/.openclaw/node/ — remove that directory:

rm -rf ~/.openclaw/node

And the wrapper at ~/.local/bin/openclaw (or the Windows equivalent):

rm -f ~/.local/bin/openclaw

Path 2 · Manual step by step (CLI present, fine control)

If you prefer to understand each step (useful on servers with audit, or to keep part of the setup), this is the order.

Step 1 · Stop the Gateway

openclaw gateway stop

Step 2 · Uninstall the system service

openclaw gateway uninstall

This step removes:

  • macOS: the LaunchAgent at ~/Library/LaunchAgents/ai.openclaw.gateway.plist and unloads it from launchd.
  • Linux: the systemd user unit at ~/.config/systemd/user/openclaw-gateway.service and disables it.
  • Windows: the Scheduled Task OpenClaw Gateway.

Step 3 · Remove state + config

rm -rf "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}"

If you used OPENCLAW_CONFIG_PATH to point to a file outside the state dir, remove that file manually afterwards.

If you want to keep the workspace (agent files), move it aside before the rm -rf:

mv ~/.openclaw/workspace ~/openclaw-workspace-backup
rm -rf ~/.openclaw

Step 4 · Remove the workspace (optional)

rm -rf ~/.openclaw/workspace

Or the backup from the previous step if you kept it temporarily.

Step 5 · Remove the CLI

npm rm -g openclaw   # or pnpm/bun as appropriate

Step 6 · Remove the macOS app (if you installed it)

rm -rf /Applications/OpenClaw.app

Path 3 · Service only (CLI is gone)

If the openclaw binary no longer responds but the daemon is still running (typical: you removed the npm global without stopping the Gateway first), this is the path.

macOS (launchd)

The default label is ai.openclaw.gateway (or ai.openclaw.<profile> if you used a profile):

launchctl bootout gui/$UID/ai.openclaw.gateway
rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist

If you used a profile, replace the label and plist with the profile name (ai.openclaw.<profile>).

Linux (systemd user unit)

The default name is openclaw-gateway.service (or openclaw-gateway-<profile>.service).

Note about old installs: if you upgraded from a much earlier version, a clawdbot-gateway.service unit (pre-rename) may remain. openclaw uninstall and openclaw gateway uninstall detect and remove it automatically; manual is:

systemctl --user disable --now openclaw-gateway.service
rm -f ~/.config/systemd/user/openclaw-gateway.service
systemctl --user daemon-reload

# If the old unit remains:
systemctl --user disable --now clawdbot-gateway.service
rm -f ~/.config/systemd/user/clawdbot-gateway.service

Windows (Scheduled Task)

The default task name is OpenClaw Gateway (or OpenClaw Gateway (<profile>)). The task launches a gateway.vbs script that runs gateway.cmd, both under the state dir.

PowerShell as admin (or normal user if the task was created per-user):

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

If you used a profile, repeat with the task name OpenClaw Gateway (<profile>) and the files under ~\.openclaw-<profile>\.

After removing the service, clean the state dir:

Remove-Item -Recurse -Force "$env:USERPROFILE\.openclaw"

If you installed from source (git clone)

If you run OpenClaw from a checkout (git clone + pnpm openclaw ...), the CLI uninstaller doesn't apply — it has to be manual.

  1. Uninstall the Gateway first (Path 3 above or openclaw gateway uninstall if the CLI is present).
  2. Remove the repo directory: rm -rf /path/to/openclaw (or wherever you cloned it).
  3. Remove state + workspace as in Path 2, steps 3 and 4.

Post-uninstall verification

After uninstalling, verify nothing remains:

# macOS / Linux
which openclaw           # should return nothing
launchctl list | grep openclaw   # should list nothing
systemctl --user list-units --type=service | grep openclaw   # should list nothing

# Windows (PowerShell)
Get-Command openclaw -ErrorAction SilentlyContinue
Get-ScheduledTask | Where-Object {$_.TaskName -like "*OpenClaw*"}

If everything returns empty, the uninstall is complete.

Reinstalling later?

If you plan to reinstall OpenClaw later (for example to try another version), you can keep the state dir:

# Just stop the daemon and remove the wrapper, keep state and workspace
openclaw gateway stop
openclaw uninstall --service --yes --non-interactive
mv ~/.openclaw ~/openclaw-state-backup
# CLI out via npm rm -g openclaw

Then, to reinstall:

curl -fsSL https://openclaw.ai/install.sh | bash
mv ~/openclaw-state-backup ~/.openclaw   # restore state
openclaw onboard --install-daemon        # reactivate daemon

Have any weird edge case (Docker, Nix, install in a container) or want help deciding if it's worth keeping something before uninstalling? There's a CTA at the end with a free 30-minute call.

Frequently asked questions

What's the quick command to uninstall OpenClaw?

If the CLI is still available, `openclaw uninstall --all --yes --non-interactive` removes the service + state + workspace + (on macOS) the app in a single pass. Without the `--all` flag, the uninstaller is interactive and asks which scopes to clean.

Does the `openclaw uninstall` command remove the CLI itself?

No. The uninstaller removes the Gateway daemon, state dir, and workspace, but leaves the CLI binary installed via npm/pnpm/bun. To remove the global CLI: `npm rm -g openclaw` (or equivalent with pnpm/bun).

How do I uninstall OpenClaw if the CLI is no longer available?

Manual service. On macOS: `launchctl bootout gui/$UID/ai.openclaw.gateway && rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist`. On Linux: `systemctl --user disable --now openclaw-gateway.service && rm -f ~/.config/systemd/user/openclaw-gateway.service && systemctl --user daemon-reload`. On Windows: `schtasks /Delete /F /TN "OpenClaw Gateway"` and remove `gateway.cmd` and `gateway.vbs` under `~\.openclaw\`.

What happens to my workspace and the agent's files?

`openclaw uninstall` keeps them unless you request `--workspace`. If you want a fresh start including the workspace, use `--all`. If you want to keep the workspace but remove config and credentials, use `--service --state`.

Does OpenClaw leave anything behind after uninstalling?

If you use the uninstaller with `--all`, no. If you installed via `git clone`, the repo directory remains (you have to delete it manually). On macOS, `~/Library/Application Support/OpenClaw/` may remain if you configured it explicitly.

How do I remove additional profiles (`--profile`)?

If you installed with `--profile foo`, state dirs live in `~/.openclaw-foo`. Repeat `openclaw uninstall --state --workspace` for each profile, or `rm -rf ~/.openclaw-foo` after stopping the matching service (`openclaw-gateway-foo.service` or the plist / schtasks with the profile suffix).