OpenClaw Uninstall Command: Remove Gateway Service and Local Data
Learn how to use the openclaw uninstall command to remove the Gateway service, state, workspace, or app. This page covers all flags and options for a clean uninstall.
Read this when
- You want to remove the gateway service and/or local state
- You want a dry-run first
openclaw uninstall
The Gateway service and/or local data can be removed with this command. Note that the CLI itself stays intact; use npm or pnpm to remove it separately.
Options
| Flag | Default | Description |
|---|---|---|
--service | false | Deletes the Gateway service. |
--state | false | Clears state and configuration. |
--workspace | false | Deletes workspace folders. |
--app | false | Removes the macOS application. |
--all | false | Equivalent to --service --state --workspace --app. |
--yes | false | Bypasses confirmation dialogs. |
--non-interactive | false | Turns off prompts; needs --yes. |
--dry-run | false | Shows what would happen without deleting anything. |
When no scope flags are given, an interactive multiselect asks which parts to remove, with service, state, and workspace already checked by default.
Examples
openclaw backup create
openclaw uninstall
openclaw uninstall --service --yes --non-interactive
openclaw uninstall --state --workspace --yes --non-interactive
openclaw uninstall --all --yes
openclaw uninstall --dry-run
Notes
Every requested scope is reported by uninstall, and a nonzero exit code appears if any cleanup fails or is prevented. If inspecting, stopping, or uninstalling the gateway service fails, changes to state and workspace are blocked, yet macOS app cleanup still proceeds on its own. Once service teardown is confirmed safe, the remaining permitted scopes run so that all failures surface together. On systems other than macOS, --app notes that the scope does not apply.
- Execute
openclaw backup createbeforehand to create a restorable snapshot prior to deleting state or workspaces. - To remove state,
--statedemands exclusive ownership of it. When an unmanaged or externally controlled Gateway remains active, uninstall declines and instructs you to halt it first. - Configured workspace directories stay intact under
--stateunless--workspaceis chosen as well.