← Blog
Guide

OpenClaw Uninstall: How to Completely Remove OpenClaw

Need to remove OpenClaw? This covers full uninstall steps for npm and Docker installs, config cleanup, data backup, and how to reinstall cleanly.

·6 min read

People uninstall OpenClaw for a few reasons: upgrading to a fresh install, switching servers, troubleshooting a broken setup, or just cleaning up a machine they were testing on. Whatever the reason, uninstalling cleanly matters — leftover config files and processes can interfere with a fresh install.

This covers everything: backing up your data first, full removal for both npm and Docker installs, cleaning up config files, and reinstalling from scratch if that's the goal.

Back Up Your Data First

Before removing anything, export what you want to keep. Once config files are deleted, they're gone.

What's Worth Backing Up

Agent workspace — Your agent's memory files, custom skills, and any content it's generated. Typically at:

~/.openclaw/workspace/

Config — Your OpenClaw configuration including channel tokens, API keys, and settings:

~/.openclaw/config.json

Skills — Any custom skills you've installed or built:

~/.openclaw/skills/

Quick Backup

# Backup everything in one archive
tar -czf openclaw-backup-$(date +%Y%m%d).tar.gz ~/.openclaw/

# Verify the archive
tar -tzf openclaw-backup-$(date +%Y%m%d).tar.gz | head -20

# Move to safe location
cp openclaw-backup-$(date +%Y%m%d).tar.gz ~/Desktop/
# or upload to S3/Backblaze/wherever

If you're migrating to a new server, this archive is all you need. Extract it on the new machine after installing OpenClaw and your agent picks up where it left off.

Uninstalling npm Install

If you installed OpenClaw via npm install -g openclaw, removal is straightforward.

Step 1: Stop the Running Process

# If running via systemd
systemctl stop openclaw
systemctl disable openclaw

# If running via PM2
pm2 stop openclaw
pm2 delete openclaw
pm2 save

# If running manually, find and kill the process
pkill -f "openclaw"
# or
ps aux | grep openclaw
kill <PID>

Step 2: Remove the npm Package

npm uninstall -g openclaw

# Verify it's gone
which openclaw
# Should return nothing (command not found)

Step 3: Remove Config and Data Files

The npm uninstall removes the binary but leaves your config and workspace intact (by design — you don't want to lose your agent's data on every update).

To remove everything:

# Remove the OpenClaw config directory
rm -rf ~/.openclaw/

# If you created a dedicated openclaw user
userdel -r openclaw  # removes home dir too

Step 4: Clean Up systemd Service (if applicable)

If you set up a systemd service:

# Stop and disable
systemctl stop openclaw
systemctl disable openclaw

# Remove the service file
rm /etc/systemd/system/openclaw.service

# Reload systemd
systemctl daemon-reload
systemctl reset-failed

Step 5: Clean Up nginx Config (if applicable)

# Remove the site config
rm /etc/nginx/sites-enabled/openclaw
rm /etc/nginx/sites-available/openclaw

# Test and reload nginx
nginx -t
systemctl reload nginx

Step 6: Clean Up PM2 (if applicable)

# Remove from PM2 startup
pm2 unstartup
pm2 save

Full Verification

After removal, verify nothing is left:

# Check the binary is gone
which openclaw

# Check config dir is gone
ls ~/.openclaw/ 2>&1

# Check no process running
ps aux | grep openclaw | grep -v grep

# Check no systemd service
systemctl status openclaw 2>&1

All of these should return empty or "not found" results.

Uninstalling Docker Install

If you're running OpenClaw via Docker, the process is slightly different.

Step 1: Stop and Remove the Container

# Stop the container
docker stop openclaw

# Remove the container
docker rm openclaw

# Or do both in one command
docker rm -f openclaw

Step 2: Remove the Docker Image

# List OpenClaw-related images
docker images | grep openclaw

# Remove the image
docker rmi openclaw/openclaw:latest
# or whatever tag you're using

Step 3: Remove Volumes

Docker volumes persist data outside the container lifecycle. If you used named volumes:

# List volumes
docker volume ls | grep openclaw

# Remove OpenClaw volumes
docker volume rm openclaw_data
docker volume rm openclaw_workspace
# adjust names to match what you created

If you used bind mounts (mapped a host directory), just delete that directory:

rm -rf /opt/openclaw/
# or wherever you mounted

Step 4: Remove docker-compose Setup (if applicable)

# Navigate to your compose directory
cd /path/to/your/openclaw/

# Bring everything down including volumes
docker-compose down -v

# Remove the directory
cd ..
rm -rf openclaw/

Full Docker Cleanup

To nuke everything Docker-related to OpenClaw:

# Stop container
docker stop openclaw 2>/dev/null

# Remove container
docker rm openclaw 2>/dev/null

# Remove image
docker rmi $(docker images | grep openclaw | awk '{print $3}') 2>/dev/null

# Remove volumes
docker volume rm $(docker volume ls | grep openclaw | awk '{print $2}') 2>/dev/null

# Remove networks (if custom network was created)
docker network rm openclaw_network 2>/dev/null

Removing Cloudflare Tunnel (if configured)

If you set up a Cloudflare Tunnel for your gateway:

# Stop the cloudflared service
systemctl stop cloudflared
systemctl disable cloudflared

# Remove the tunnel via CLI
cloudflared tunnel delete openclaw

# Uninstall cloudflared service
cloudflared service uninstall

# Remove cloudflared binary and config
apt remove cloudflared  # if installed via apt
rm -rf ~/.cloudflared/

Common Issues After Incomplete Uninstall

openclaw: command not found but process still running — The binary is gone but an old process is still alive. pkill -f openclaw clears it.

Fresh install fails with config errors — Old config files at ~/.openclaw/ are conflicting with the new install. Back them up and delete the directory before reinstalling.

Port 3000 already in use after reinstall — Old process didn't fully stop. lsof -i :3000 shows what's using it. Kill that PID.

systemd service errors on new install — Old service file with different settings. Remove the old service file as described above, then create a fresh one.

Reinstalling After Uninstall

Once you've confirmed the old install is fully removed:

# Install latest version
npm install -g openclaw

# Verify version
openclaw --version

# Initialize fresh config
openclaw init

# Or restore from backup
tar -xzf openclaw-backup-20260330.tar.gz -C ~/

If you're reinstalling on the same machine, restore your backup after openclaw init so your config and workspace come back.

For a full fresh server setup, see OpenClaw Hosting for the complete provisioning walkthrough, or the Hostinger OpenClaw guide if you're on Hostinger.

When Uninstall Is Actually the Wrong Move

Sometimes people uninstall when what they actually need is:

Config reset — If your setup is broken but the install is fine: openclaw config reset resets to defaults without removing the binary.

Gateway restart — If the gateway won't respond: openclaw gateway restart before reaching for uninstall.

Version updatenpm update -g openclaw updates in place. You don't need to uninstall to upgrade.

Moving to Docker — You can run a Docker install alongside an npm install (different ports). No need to uninstall npm first.

If something is broken, check the logs before removing everything:

openclaw logs
journalctl -u openclaw -n 100

Most issues are config or network problems, not installation problems.


If you are moving off a self-managed setup, make sure your replacement covers provisioning, config, updates, backups, and rollback before you migrate.