How to Uninstall OpenClaw on Linux

Step-by-step guide to fully uninstall OpenClaw on Linux — remove the CLI, systemd services, config, caches, and verify a clean state.
Mar 13, 2026

Step 1: Open a terminal

Open your terminal emulator of choice, or press Ctrl + Alt + T on most desktop environments.

Step 2: Quick uninstall (CLI still installed)

If the openclaw command still works, run:

openclaw uninstall --all --yes
  • uninstall — tells the program you want to remove it.
  • --all — removes everything: gateway service, local database, config files.
  • --yes — auto-confirms all prompts.

For fully non-interactive use (scripts, CI, npx):

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

Step 3: Remove the CLI tool

After the uninstall command finishes, only the CLI shell remains. Remove it with whichever package manager you originally used:

npm rm -g openclaw
# or
pnpm remove -g openclaw
# or
bun remove -g openclaw

Step 4: Manual service removal (CLI already gone)

If the openclaw command is missing but the gateway service is still running:

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

If you used profiles, the unit name is openclaw-gateway-<profile>.service — adjust accordingly.

Step 5: Delete state, config, and workspace

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

If you set OPENCLAW_CONFIG_PATH to a custom location outside the state directory, delete that file too. If you used profiles, repeat for each state dir (e.g. ~/.openclaw-<profile>).

Step 6: Review common Linux leftovers

CategoryPlaces to check
Config~/.config/openclaw
Local share/state~/.local/share/openclaw, ~/.local/state/openclaw
Cache~/.cache/openclaw
Project foldersRepo or workspace folders tied to your setup
Shell config~/.bashrc, ~/.zshrc, ~/.profile

Step 7: Check services and startup layers

Linux users should explicitly verify these are clean:

  • systemd user unitssystemctl --user list-units | grep openclaw
  • systemd system unitssystemctl list-units | grep openclaw
  • cron jobscrontab -l | grep openclaw
  • Shell startup files — check for aliases, PATH entries, or source lines referencing OpenClaw.

If something keeps restarting after uninstall, service cleanup is usually incomplete.

Step 8: Check shell profile changes

Review and clean up:

  • ~/.bashrc
  • ~/.zshrc
  • ~/.profile
  • ~/.bash_profile

Remove any OPENCLAW_* environment variables, PATH entries, or source lines that reference OpenClaw.

Step 9: Reboot and verify

  1. Restart the shell session or reboot the machine.
  2. Run:
which openclaw
ps aux | grep openclaw
systemctl --user list-units | grep openclaw

All three should return empty results.

Important notes

  • Reboot recommended — restart your machine or at least log out and back in to ensure all user services are stopped.
  • Revoke API keys — if you bound API keys (OpenAI, Claude, etc.) in OpenClaw, go to the provider dashboard and revoke the old keys, then generate new ones.
  • Remote mode — if you used remote mode, the state directory lives on the gateway host. Run the cleanup steps there too.
  • Source checkout — if you ran OpenClaw from a git clone, uninstall the gateway service first, then delete the repo directory and state files.

How to Uninstall OpenClaw on Linux