Created
February 20, 2026 17:55
-
-
Save sony-mathew/c2f1afcbf19e33ea4469a5a8dc195f73 to your computer and use it in GitHub Desktop.
Uninstall OpenClaw (aka clawdbot aka moltbot) (2026)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # --- OpenClaw (2026) Scorched Earth Uninstaller --- | |
| # Supports: macOS & Linux (Ubuntu, Debian, Raspberry Pi OS) | |
| echo "🦞 Starting OpenClaw Deep Clean..." | |
| # 1. Attempt the "Easy Path" if the CLI is still working | |
| if command -v openclaw &> /dev/null; then | |
| echo "Stopping gateway and running built-in uninstaller..." | |
| openclaw gateway stop &> /dev/null | |
| openclaw uninstall --all --yes --non-interactive &> /dev/null | |
| fi | |
| # 2. Stop and Remove Services (System-Specific) | |
| if [[ "$OSTYPE" == "linux-gnu"* ]]; then | |
| echo "Detected Linux. Cleaning systemd user services..." | |
| systemctl --user stop openclaw-gateway.service 2>/dev/null | |
| systemctl --user disable openclaw-gateway.service 2>/dev/null | |
| rm -f ~/.config/systemd/user/openclaw-gateway.service | |
| # Disable lingering if it was enabled for the gateway | |
| sudo loginctl disable-linger "$USER" 2>/dev/null | |
| systemctl --user daemon-reload | |
| elif [[ "$OSTYPE" == "darwin"* ]]; then | |
| echo "Detected macOS. Cleaning launchd agents..." | |
| launchctl bootout gui/$UID/ai.openclaw.gateway 2>/dev/null | |
| launchctl bootout gui/$UID/bot.molt.gateway 2>/dev/null | |
| rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist | |
| rm -f ~/Library/LaunchAgents/bot.molt.gateway.plist | |
| rm -rf /Applications/OpenClaw.app | |
| fi | |
| # 3. Uninstall Global Packages (npm, pnpm, bun) | |
| echo "Removing global CLI packages..." | |
| npm uninstall -g openclaw &> /dev/null | |
| pnpm remove -g openclaw &> /dev/null | |
| bun remove -g openclaw &> /dev/null | |
| sudo rm -f /usr/local/bin/openclaw /usr/bin/openclaw | |
| # 4. Wipe All Data and Legacy Directories | |
| echo "Purging configuration and state data..." | |
| # Includes current and legacy directory names (Clawdbot/Moltbot) | |
| DIRS=( | |
| "$HOME/.openclaw" | |
| "$HOME/.clawdbot" | |
| "$HOME/.moltbot" | |
| "$HOME/clawdbot" | |
| "$HOME/.identity" | |
| ) | |
| for dir in "${DIRS[@]}"; do | |
| if [ -d "$dir" ]; then | |
| echo "Removing $dir..." | |
| rm -rf "$dir" | |
| fi | |
| done | |
| # 5. Verification | |
| echo "---" | |
| if ! command -v openclaw &> /dev/null; then | |
| echo "✅ OpenClaw has been successfully removed." | |
| echo "Your system is now ready for a fresh install." | |
| else | |
| echo "⚠️ Warning: If 'openclaw' command still responds at $(which openclaw), you may need to delete that binary manually." | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment