Sometimes you need to remove an assistant cleanly, whether you are switching to a different setup, moving servers, or just starting fresh. OpenClaw leaves files in a few predictable locations. This guide covers all of them so you do not leave orphaned processes, lingering configs, or an active Telegram bot behind.
1. Stop the OpenClaw Gateway
Before removing any files, shut down the running process:
openclaw gateway stop
If you set up OpenClaw as a systemd service:
systemctl stop openclaw
systemctl disable openclaw
Confirm nothing is still running:
pgrep -a node | grep openclaw
2. Disconnect Your Telegram Bot
If you connected OpenClaw to Telegram via BotFather, the bot token will keep accepting messages until you delete the bot or revoke the token. To stop it receiving messages without fully deleting the bot, send /mybots to BotFather, select your bot, and choose Revoke Token. Alternatively, delete the bot entirely from the same menu.
This step matters if you are moving to a new server. A stale token pointing at a dead server will silently drop every message the bot receives.
3. Remove the OpenClaw Package
OpenClaw is installed as a global npm package:
npm uninstall -g openclaw
Verify it is gone:
which openclaw # should return nothing
4. Delete Config and Workspace Files
OpenClaw stores its config and workspace in your home directory. The main locations:
~/.openclaw/- Gateway config, secrets, session data, skills, plugin data~/.openclaw/workspace/- Your workspace: MEMORY.md, daily notes, repos, scripts
Back up your workspace first if you want to keep MEMORY.md, your keyword maps, publishing scripts, or any project files:
cp -r ~/.openclaw/workspace ~/openclaw-workspace-backup
Then remove everything:
rm -rf ~/.openclaw
If you installed the systemd unit file manually, remove that too:
rm -f /etc/systemd/system/openclaw.service
systemctl daemon-reload
5. Remove Node.js Dependencies (Optional)
If you installed Node.js specifically for OpenClaw and do not need it for anything else:
# Check what else uses node first
which node && node --version
# If safe to remove (Ubuntu/Debian)
apt remove nodejs npm
apt autoremove
6. Check for Cron Jobs
If you set up any OpenClaw-related cron jobs (heartbeat schedules, blog publish scripts), remove them:
crontab -l # review active crons
crontab -e # remove any openclaw entries
Reinstalling Later
If you want to come back to OpenClaw on a fresh basis, the full install process takes under 30 minutes. See the VPS install guide, or if you want to understand what you are getting first, start with What Is OpenClaw. The self-hosted vs ChatGPT comparison is also worth reading if you are evaluating whether to come back at all.
- Gateway stopped (and systemd service disabled if applicable)
- Telegram bot token revoked or bot deleted
- npm package removed:
npm uninstall -g openclaw - ~/.openclaw/ directory deleted (backup first if needed)
- Systemd unit file removed if created
- Cron jobs cleared