OpenClaw operations guide
Uninstall OpenClaw and reinstall it cleanly
To uninstall OpenClaw, back up your data first. With a local CLI, run openclaw uninstall and choose the Gateway service and any data you want to delete. Then follow the steps for npm, the installer script or the macOS app. For Docker, use docker compose down. Your mounted data stays on the host.
Last updated · Published
By CWYN · · Checked against docs, not run · OpenClaw uninstall reference and Docker Compose commands
1. Back up the installation you intend to replace
For Docker, go straight to the container backup and removal steps. For a local CLI install, run openclaw backup create --verify on the Gateway host for the profile you want to remove. Run it from a private folder outside its state and workspaces. Keep the verified archive there. It can contain credentials and conversations. Check that every workspace you need appears in the backup. OpenClaw backup reference.
- State and config. The default state folder is
~/.openclaw. It containsopenclaw.json, channel credentials undercredentials/and per-agent data, including sessions, underagents/. A named profile normally uses~/.openclaw-<profile>. CheckOPENCLAW_STATE_DIRandOPENCLAW_CONFIG_PATHfor custom locations. - Workspace.
~/.openclaw/workspaceholds agent files such as instructions and memories. Agents can use other directories. Move any workspace you want to keep outside the state folder before deleting that folder by hand. OpenClaw workspace layout.
If the CLI is missing, stop the Gateway using the service instructions below, then copy the whole state folder, any separate config and each workspace to private storage. Check the copies before deleting the originals.
2. Preview the removal scopes
With the local CLI still installed, run openclaw uninstall --dry-run --all. Review the service, state, workspace and macOS app listed for this profile. If your Mac connects to a remote Gateway, its state lives on the remote host. Uninstalling the client leaves that Gateway running.
3. Stop and remove the local Gateway service
If the macOS app manages this Gateway, quit the app first. Run openclaw uninstall. The prompt selects the Gateway service by default. Select state as well to remove the profile’s config, credentials and sessions. Leave workspace unchecked to keep configured workspaces, or select it to delete them after verifying the backup. If service removal fails, resolve the reported error before deleting data. Uninstall options.
To remove just the service manually, run openclaw gateway stop, then openclaw gateway uninstall. The first stops the process. The second removes its startup registration. Both leave your data in place. If the CLI is gone, follow the manual service removal instructions for your LaunchAgent on macOS, systemd user unit on Linux or Scheduled Task on Windows. Match the service name to the profile.
4. Remove OpenClaw by install method
Uninstall the global npm package
After the service and data choices above, run npm rm -g openclaw with the npm installation that owns the package. Removing the global npm package can leave your previous Gateway state and configuration behind. If your shell still finds OpenClaw, check the npm launcher and PATH for another copy.
Uninstall OpenClaw after using the installer script
The standard install.sh and install.ps1 scripts use global npm by default, so the final command is npm rm -g openclaw. If you chose Git, inspect ~/.local/bin/openclaw or %USERPROFILE%\.local\bin\openclaw.cmd on Windows. Check which checkout it starts, save your changes there, then remove that launcher and its checkout.
The separate install-cli.sh script uses a private installation directory. Inspect <prefix>/bin/openclaw first. The default prefix, ~/.openclaw, can hold both the CLI and your data. After backing up, remove the dedicated prefix and, for Git mode, its separate checkout. OpenClaw instructions by installation owner.
Uninstall the macOS app
Quit OpenClaw. If you have the CLI, select the app alongside the local service in the uninstall prompt. If the CLI is gone and this Mac runs the default local Gateway, use the two commands below to unload the service and remove its startup file. For a named profile, use its launchd label and matching plist filename.
launchctl bootout gui/$UID/ai.openclaw.gateway
rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Move /Applications/OpenClaw.app to the Trash in Finder if it remains. Removing only the app bundle leaves local state, workspaces and any separately installed CLI. If the app connected to a remote Gateway, removing the client leaves the service and its data on the remote host.
Uninstall the Docker Compose stack
From the running stack’s Compose project directory, use the same Compose files and run docker compose down. This stops and removes the containers. Bind-mounted folders, named volumes and the project’s .env remain. OpenClaw Compose commands.
With the stack down, check the host paths for OPENCLAW_CONFIG_DIR, OPENCLAW_WORKSPACE_DIR and OPENCLAW_AUTH_PROFILE_SECRET_DIR. Copy those folders and the project’s .env to private storage. If you used named volumes, back up their contents too. Verify the copies before deleting a dedicated folder or volume. For a clean reinstall you can leave the backups and old volumes in place and choose empty mounts. Docker storage and persistence.
5. Reinstall and test a fresh setup
Start with an empty state directory. Move any surviving config file at OPENCLAW_CONFIG_PATH into your backup and choose an empty workspace during onboarding.
For npm 11.15 and earlier, run npm install -g openclaw@latest. For npm 11.16+ or npm 12, run npm install -g openclaw@latest --allow-scripts=openclaw. Then run openclaw onboard --install-daemon. If you reinstall with the standard installer script, it offers onboarding itself. Run openclaw gateway status and check that the new service is running. OpenClaw install reference.
For the Mac app, install the app again and choose This Mac during local onboarding. For Docker, start with fresh config, workspace and key mounts, then run ./scripts/docker/setup.sh from the OpenClaw repository root. It runs onboarding and starts the stack. Send one dashboard message and confirm a reply before restoring selected workspace files. OpenClaw Docker setup.
If you want to rebuild the agent’s instructions before copying files back, start with the editable workspace files in the OpenClaw Complete Setup Pack.
Proof: what was checked
- Version
- OpenClaw 2026.11.10 (Node v26.5.0)
- Date checked
- Method
- Tested: help output checked on a clean install.
- Symptom
- Removing the global npm package can leave your previous Gateway state and configuration behind.
- Fix
- Back up the installation, remove the old service and state, then reinstall with a fresh workspace.
- Evidence
-
The
--helppages confirmed the commands and flags inopenclaw backup create --verify,openclaw uninstall --dry-run --all,openclaw onboard --install-daemon --workspace <new-directory>andopenclaw gateway status. Each help page showed this header.OpenClaw 2026.11.10 (6ea542f)In a non-interactive shell with an empty state directory, the dry run stopped at this prompt before listing anything. Answer No to stop.
Proceed with uninstall?