Removing OpenClaw involves separate scopes: the Gateway service, state, workspace, desktop app, and CLI package. Decide what to preserve before removal and confirm any backups first.
Start with the built-in uninstaller
If the CLI is still available, inspect all removal scopes first:
| |
Review the exact directories and services, then use the interactive flow:
| |
The current official prompt initially selects only the Gateway service. State, workspace, and app are separate choices; --all selects all four scopes. Removing state does not imply removing configured workspaces. Service-removal failure may preserve data scopes and produce a partial-cleanup error.
If the CLI is gone but its service remains, follow the operating-system-specific official manual removal instructions. Do not terminate every Node.js process.
The optional scripts below perform narrower package/process/Docker inventory and cleanup. They do not replace the built-in state, workspace, and service removal workflow.
Automated Uninstallation (Inspect Before Applying)
The cleanup scripts default to a read-only dry run. They list detected OpenClaw global packages, Node.js processes whose command line explicitly identifies OpenClaw, and resources in the current Docker context whose name or image explicitly matches OpenClaw. They do not stop every Node.js process or scan and remove user directories, configuration files, registry values, or arbitrary Docker resources.
Do not execute remote scripts through curl | bash or irm | iex. Download the file, verify its SHA-256 digest, inspect it, and run the dry-run first. After reviewing the plan, use -Apply/--apply; interactive mode also requires typing REMOVE OPENCLAW.
Windows (PowerShell)
| |
Administrator privileges are normally unnecessary. Use an elevated terminal only if your installation location or Docker environment specifically requires it. -Apply -Yes is reserved for controlled automation after the plan has been reviewed.
Linux (Bash)
| |
macOS (Bash)
| |
Remove the CLI package and verify
After the requested service and data scopes are handled, uninstall the CLI with the package manager that installed it. Choose one:
| |
Treat third-party forks such as openclaw-cn separately. Use the actual package prefix and reviewed inventory rather than deleting a guessed system-wide directory. Recheck the former service and command resolution; the absence of a CLI command alone does not prove removal of a background service.
Common problems
For permission errors, identify the installation location or Docker permission requirement first. Do not elevate every cleanup action by default.
If a command cannot be found, check the PATH and package-manager environment used for that installation. The inventory is limited to what the script can actually detect.
A dry run reports a plan. Successful cleanup requires checking the apply result and any remaining service or resource.
Official reference
OpenClaw uninstall scopes, preview, and manual service removal