OpenClaw Uninstall Guide
This article explains how to completely uninstall OpenClaw, including the CLI, Gateway service, configuration files, and workspace data.
There are two scenarios for uninstalling OpenClaw:
- CLI still exists (recommended approach)
- CLI has been deleted but background services are still running (manual cleanup)
I. Recommended Approach (CLI Still Exists)
If the openclaw command can still be run on your 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
- Data such as the Agent workspace directory
2. Non-interactive Uninstall (Automation Scripts)
Suitable for CI or automated script environments:
# 直接执行 openclaw uninstall --all --yes --non-interactive # 无本地 CLI 时,通过 npx 执行 npx -y openclaw uninstall --all --yes --non-interactive
- uninstall: Uninstaller
- --all: Removes services and local data together (including gateway service, configuration files, database, etc.)
- --yes: Automatically confirms, so you don't have to manually type Y repeatedly
II. Manual Uninstall (Complete Cleanup)
If you want complete control over the uninstall process, you can manually clean up by following the steps below.
1. Stop the Gateway Service
openclaw gateway stop
2. Uninstall the Gateway Service
openclaw gateway uninstall
This step will remove the background services from the system:
- macOS:launchd
- Linux:systemd
- Windows:Scheduled Tasks
3. Delete Configuration and State Directories
rm -rf "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}"
Default directories:
~/.openclaw
These include:
- 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 files.
4. Delete Agent Workspace (Optional)
rm -rf ~/.openclaw/workspace
This directory typically stores:
- Agent-generated code
- Task execution files
- Intermediate data
5. Delete the CLI
Select the corresponding command based on the installation method:
# npm 安装 npm rm -g openclaw # pnpm 安装 pnpm remove -g openclaw # bun 安装 bun remove -g openclaw
6. Delete the macOS App (If Installed)
rm -rf /Applications/OpenClaw.app
III. CLI Lost but Services Still Running
If you have already deleted the CLI 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(For multi-config:bot.molt.<profile>, for old versions:com.openclaw.*)
# 停止并卸载服务 launchctl bootout gui/$UID/bot.molt.gateway # 删除服务配置文件 rm -f ~/Library/LaunchAgents/bot.molt.gateway.plist # 多配置场景:替换为对应 profile 标签 # launchctl bootout gui/$UID/bot.molt.<profile> # rm -f ~/Library/LaunchAgents/bot.molt.<profile>.plist # 清理旧版残留(如有) rm -f ~/Library/LaunchAgents/com.openclaw.*.plist
2. Linux (systemd User Service)
Default service name:openclaw-gateway.service(For multi-config:openclaw-gateway-<profile>.service)
# 停止并禁用服务 systemctl --user disable --now openclaw-gateway.service # 删除服务配置文件 rm -f ~/.config/systemd/user/openclaw-gateway.service # 刷新 systemd 配置 systemctl --user daemon-reload # 多配置场景:替换为对应 profile 服务名 # systemctl --user disable --now openclaw-gateway-<profile>.service # rm -f ~/.config/systemd/user/openclaw-gateway-<profile>.service # systemctl --user daemon-reload
3. Windows (Scheduled Task)
Default task name:OpenClaw Gateway(For multi-config:OpenClaw Gateway (<profile>))
# 删除计划任务 schtasks /Delete /F /TN "OpenClaw Gateway" # 删除任务脚本 Remove-Item -Force "$env:USERPROFILE\.openclaw\gateway.cmd" # 多配置场景:替换为对应 profile 任务名 # schtasks /Delete /F /TN "OpenClaw Gateway (<profile>)" # Remove-Item -Force "$env:USERPROFILE\.openclaw-<profile>\gateway.cmd"
IV. Uninstalling Docker Installations
If OpenClaw is running in Docker:
docker stop openclaw docker rm openclaw docker volume rm openclaw-data
or
docker-compose down -v
V. Uninstalling Source Installation (git clone)
If installed viagit clonesource installation, you need to clean up the service first, then delete the source code and configuration:
- First execute the "recommended uninstall method" or "manually clean up service remnants" to stop and uninstall the gateway service
Delete the source repository directory
# 替换为你的源码路径 rm -rf /path/to/openclaw-repo
- Delete the state, configuration, and workspace directories following the previous steps
VI. Recommended Backup Before Uninstalling
If you need to keep data, you can create a backup first:
openclaw backup create
Then proceed with the uninstallation.
Uninstall Verification
After uninstallation, you can verify whether cleanup is complete in the following ways:
- Run
openclaw --version, if it prompts "command not found", the CLI was uninstalled successfully - Check system services:
- macOS:
launchctl list | grep moltNo output - Linux:
systemctl --user list-units | grep openclawNo output - Windows: No "OpenClaw Gateway"-related tasks in Task Scheduler
- macOS:
- Check directories:
~/.openclaw(and multi-config~/.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.serviceOther extensions