OpenClaw Uninstallation Guide
OpenClaw Uninstallation Guide
This article introduces how to completely uninstall OpenClaw, including the CLI, Gateway service, configuration files, and workspace data.
There are two scenarios for OpenClaw uninstallation:
- CLI still exists (Recommended method)
- CLI has been deleted but background services are still running (Manual cleanup)
I. Recommended Method (CLI still exists)
If the openclaw command can still be run in the system, it is recommended to use the built-in uninstall command.
1. Standard uninstall
openclaw uninstall
This command will delete:
- Gateway service
- Local state data
- Configuration files
- Agent working directory and other data
2. Non-interactive uninstall (automation scripts)
Suitable for CI or automated script environments:
Original prompt (Chinese, left untranslated)
# 直接执行
openclaw uninstall --all --yes --non-interactive
# Execute via npx when no local CLI is present
npx -y openclaw uninstall --all --yes --non-interactive
- uninstall: Uninstall the program
- --all: Clears services and local data together (including gateway service, configuration files, database, etc.)
- --yes: Automatically confirms, so you don't have to manually enter Y repeatedly
II. Manual Uninstall (Complete Cleanup)
If you want complete control over the uninstallation process, you can manually clean up by following these steps.
1. Stop the Gateway service
openclaw gateway stop
2. Uninstall the Gateway service
openclaw gateway uninstall
This step will delete the background services in the system:
- macOS: launchd
- Linux: systemd
- Windows: Scheduled Tasks
3. Delete configuration and status directories
rm -rf "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}"
Default directory:
~/.openclaw
Contains:
- Configuration files
- Token
- Session
- Logs
- Agent state data
If custom environment variables were set:
OPENCLAW_CONFIG_PATH
You also need to manually delete the corresponding file.
4. Delete Agent workspace (optional)
rm -rf ~/.openclaw/workspace
This directory usually stores:
- Code generated by the Agent
- Task execution file
- Intermediate data
5 Delete CLI
Select the corresponding command based on the installation method:
Original prompt (Chinese, left untranslated)
# npm 安装
npm rm -g openclaw
# pnpm 安装
pnpm remove -g openclaw
# bun 安装
bun remove -g openclaw
6. Delete macOS application (if installed)
rm -rf /Applications/OpenClaw.app
III. CLI is missing but the service is still running
If the CLI has already been deleted but OpenClaw Gateway is still running in the background, you can manually delete the system service.
1. macOS (launchd service)
Default service label:bot.molt.gateway(Multiple configurations asbot.molt.<profile>, old version ascom.openclaw.*)
Original prompt (Chinese, left untranslated)
# Stop and uninstall service
launchctl bootout gui/$UID/bot.molt.gateway
# Delete service configuration file
rm -f ~/Library/LaunchAgents/bot.molt.gateway.plist
# Multiple configuration scenarios: replace with corresponding profile tag
# launchctl bootout gui/$UID/bot.molt.<profile>
# rm -f ~/Library/LaunchAgents/bot.molt.<profile>.plist
# Clean up old versions (if any)
rm -f ~/Library/LaunchAgents/com.openclaw.*.plist
2. Linux (systemd user service)
Default service name:openclaw-gateway.service(Multiple configurations asopenclaw-gateway-<profile>.service)
Original prompt (Chinese, left untranslated)
# Stop and disable service
systemctl --user disable --now openclaw-gateway.service
# Delete service configuration file
rm -f ~/.config/systemd/user/openclaw-gateway.service
# Reload systemd configuration
systemctl --user daemon-reload
# Multiple configuration scenarios: replace with corresponding profile service name
# systemctl --user disable --now openclaw-gateway-<profile>.service
# rm -f ~/.config/systemd/user/openclaw-gateway-<profile>.service
# systemctl --user daemon-reload
3. Windows (Task Scheduler)
Default task name:OpenClaw Gateway(Multiple configurations forOpenClaw Gateway (<profile>))
Original prompt (Chinese, left untranslated)
# 删除计划任务
schtasks /Delete /F /TN "OpenClaw Gateway"
# Delete task script
Remove-Item -Force "$env:USERPROFILE\.openclaw\gateway.cmd"
# Multiple configuration scenarios: replace with corresponding profile task name
# schtasks /Delete /F /TN "OpenClaw Gateway (<profile>)"
# Remove-Item -Force "$env:USERPROFILE\.openclaw-<profile>\gateway.cmd"
Four. Uninstallation method for Docker installation
If OpenClaw is running in Docker:
docker stop openclaw
docker rm openclaw
docker volume rm openclaw-data
Or
docker-compose down -v
Five. Uninstallation for source code installation (git clone)
If installed viagit clonesource code, you must first clean up the service, then delete the source code and configuration:
- First, execute "Recommended Uninstall Method" or "Manually Clean Service Residue" to stop and uninstall the gateway service
-
Delete the source code repository directory
Original prompt (Chinese, left untranslated)
# 替换为你的源码路径
rm -rf /path/to/openclaw-repo 3. Then delete the status, configuration, and workspace directories as described above
VI. Backup Recommended Before Uninstalling
If you need to keep the data, you can first create a backup:
openclaw backup create
Then execute the uninstall.
Uninstall verification
After uninstalling, you can verify complete cleanup in the following ways:
- Execute
openclaw --versionIf it prompts "command not found", the CLI uninstallation was successful - Check system services:
- macOS:
launchctl list | grep moltNo output - Linux:
systemctl --user list-units | grep openclawNo output - Windows: No tasks related to "OpenClaw Gateway" in Task Scheduler
- Check directories:
~/.openclaw(and multiple configurations~/.openclaw-<profile>)have been deleted
VII. Common residual directories
When completely uninstalling, it is recommended to check the following directories:
~/.openclaw
~/.openclaw/workspace
~/Library/LaunchAgents/ai.openclaw.gateway.plist
~/.config/systemd/user/openclaw-gateway.service