How to Completely Remove Docker (Without Leaving a Trace)
Want to uninstall Docker from your system the right way? This guide walks you through completely removing Docker—containers, images, volumes, configs, and all—without leaving a single trace behind.

Whether you're switching container runtimes, troubleshooting issues, or doing a clean reinstall — it's important to know how to fully remove Docker from your system the correct way.
This guide will walk you through completely uninstalling Docker — including containers, images, volumes, configuration files, and dependencies — so nothing is left behind.
We’ll cover instructions for:
- ✅ Ubuntu / Debian (Linux)
- ✅ macOS
- ✅ Windows (WSL or native)
- ✅ Bonus: Remove Docker Desktop + Docker Compose
Let’s clean house properly.
🛠️ Step-by-Step: Remove Docker on Linux (Ubuntu/Debian)
🔍 Step 1: Stop Docker Service
sudo systemctl stop docker
Optional (if installed):
sudo systemctl stop docker.socket
🗑️ Step 2: Uninstall Docker Engine, CLI, and Containerd
sudo apt-get purge -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
🧹 Step 3: Remove All Docker Data
sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd
sudo rm -rf /etc/docker
sudo rm -rf /var/run/docker*
Also remove user and CLI configs:
sudo rm -rf ~/.docker
sudo rm -f /usr/local/bin/docker-compose
sudo rm -f /usr/bin/docker
📦 Step 4: Clean Up Package Data
sudo apt-get autoremove -y
sudo apt-get autoclean
🍎 Completely Uninstall Docker on macOS
If you installed via Docker Desktop:
🗑️ Step 1: Uninstall via App
- Open
Applications
- Right-click Docker.app → Move to Trash
🔥 Step 2: Remove All Docker Files
rm -rf ~/.docker
rm -rf /usr/local/bin/docker
rm -rf /usr/local/bin/docker-compose
rm -rf /usr/local/bin/docker-*
rm -rf ~/Library/Containers/com.docker.*
rm -rf ~/Library/Application\ Support/Docker*
rm -rf ~/Library/Group\ Containers/group.com.docker
rm -rf ~/Library/Preferences/com.docker.docker.plist
rm -rf ~/Library/Saved\ Application\ State/com.docker.docker.savedState
🪟 Remove Docker from Windows (WSL or Native)
Step 1: Uninstall Docker Desktop
- Go to Control Panel > Programs > Uninstall a Program
- Uninstall Docker Desktop
Step 2: Manually Remove Leftovers (PowerShell)
Remove-Item -Recurse -Force "$Env:APPDATA\Docker"
Remove-Item -Recurse -Force "$Env:LOCALAPPDATA\Docker"
Remove-Item -Recurse -Force "$Env:USERPROFILE\.docker"
🧹 Step 3: Clear WSL Docker VM (Optional)
wsl --unregister docker-desktop
wsl --unregister docker-desktop-data
🧼 Bonus: Remove Docker Compose (Old Binary)
If you installed Docker Compose manually:
sudo rm -f /usr/local/bin/docker-compose
Or on macOS:
rm -f /usr/local/bin/docker-compose
✅ Check for Leftovers
Make sure Docker is gone:
which docker
docker --version
Both should return nothing or command not found.
🧪 Optional: Scan for Orphaned Files
On Linux/macOS:
sudo find / -name "*docker*"
On Windows: Use the Everything Search Tool.
🧘 Final Thoughts
Docker is incredibly useful, but when it's time to uninstall, do it cleanly to avoid:
- Orphaned containers using disk space
- Conflicting Docker versions
- Configuration bugs in reinstallation
By following this guide, you've removed Docker, Docker Compose, images, volumes, settings, and even WSL-based instances.