- Easy path if
openclawis still installed. - Manual service removal if the CLI is gone but the service is still running.
Easy path (CLI still installed)
The command attempts independent requested cleanup scopes and returns a nonzero status if any scope fails or is blocked. Service teardown remains the safety gate for state and workspace deletion; if that gate fails, those data scopes are preserved while app cleanup is still attempted. Partial cleanup is reported explicitly and is never followed by an unconditional completion result.openclaw uninstall --all. State removal preserves configured workspace
directories unless you also select --workspace.
Preview what will be removed (safe):
--service, --state, --workspace, --app select individual scopes; --all selects all four.
Unlike openclaw uninstall --state, manual state deletion does not preserve
workspaces. Stop and uninstall the service successfully before deleting files.
Before manual state or prefix deletion, move any configuration you want to keep outside that directory.
- Stop the gateway service:
- Uninstall the gateway service (launchd/systemd/schtasks):
- Decide whether to preserve the workspace.
~/.openclaw/workspace,
outside the state directory before manual deletion. Workspaces inside that directory
will otherwise be deleted with it; they need no separate deletion.
- Delete state + config:
OPENCLAW_CONFIG_PATH to a custom location outside the state dir, delete that file too.
Restore preserved workspaces after recreating their parent, or configure their new paths on reinstall.
- Delete an external workspace only if you want to remove its agent files too:
- Remove the CLI using the installation owner below.
- If you installed the macOS app:
- If you used profiles (
--profile/OPENCLAW_PROFILE), repeat steps 3-4 for each state dir (defaults are~/.openclaw-<profile>). - In remote mode, the state dir lives on the gateway host, so run steps 1-4 there too.
Manual service removal (CLI not installed)
Use this if the gateway service keeps running butopenclaw is missing.
macOS (launchd)
Default label isai.openclaw.gateway (or ai.openclaw.<profile> with a profile):
ai.openclaw.<profile>.
Linux (systemd user unit)
Default unit name isopenclaw-gateway.service (or openclaw-gateway-<profile>.service). A pre-rename clawdbot-gateway.service unit may still exist on machines upgraded from very old installs; openclaw uninstall / openclaw gateway uninstall detects and removes it automatically.
Windows (Scheduled Task)
Default task name isOpenClaw Gateway (or OpenClaw Gateway (<profile>)).
The task launches a windowless gateway.vbs script under your state dir, which in turn
runs gateway.cmd; remove both.
gateway.cmd /
gateway.vbs files under ~\.openclaw-<profile>.
Remove the CLI
Remove the Gateway service before deleting a checkout, launcher, or prefix. Inspect the resolved command and its target first; if ownership is unclear, leave it in place. Check Installer internals for custom checkout and prefix options.
Git checkouts default to
~/openclaw (%USERPROFILE%\openclaw on Windows); use the actual target of the launcher, including custom --git-dir / -GitDir or OPENCLAW_GIT_DIR. On POSIX, OPENCLAW_HOME can change the default checkout. Remove state/workspaces only as selected above.
Before deleting a prefix, move any state, configuration, and workspaces you want to keep outside it. Never delete a shared prefix wholesale: remove only verified OpenClaw files, preserving shared Node runtimes, packages, and tools.
If completion was installed, remove only its # OpenClaw Completion block and OpenClaw source line from the selected shell profile. Remove a legacy openclaw completion source/eval line only if it contains no other command; preserve surrounding content.
Remove an installer-added PATH entry only when no other command uses it. Keep shared bin directories such as ~/.local/bin. On Windows, the same rule applies to portable Node/MinGit and their PATH entries under %LOCALAPPDATA%\OpenClaw\deps.
Open a new shell and check command -v openclaw (PowerShell: Get-Command openclaw -ErrorAction SilentlyContinue). If a command still resolves, inspect it: a second install or foreign wrapper may remain.
Related
- Install overview
- Migration guide
openclaw uninstall— command reference and flags