🐳 How to Completely Remove Docker from Your System
Whether you're troubleshooting, switching container engines, or simply freeing up space, uninstalling Docker from your system requires more than just a basic remove command. Here's a step-by-step guide to ensure Docker is completely removed from your system — along with all its components and data.
🔍 Why Remove Docker?
You might want to uninstall Docker if:
- You're switching to another container platform (like Podman or containerd).
- You're encountering persistent errors and want a clean slate.
- You're no longer using containers and want to reclaim system space.
🧹 How to Remove Docker (Step-by-Step)
✅ For Ubuntu / Debian-based Systems
bashCopyEditsudo apt-get purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo apt-get autoremove --purge -ysudo rm -rf /var/lib/dockersudo rm -rf /var/lib/containerd
💡 This removes the Docker engine, CLI tools, plugins, and all container images, containers, volumes, and configuration files.
✅ For CentOS / RHEL-based Systems
bashCopyEditsudo yum remove docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-pluginsudo rm -rf /var/lib/dockersudo rm -rf /var/lib/containerd
🛠️ You might also want to clean up leftover config files in /etc/docker/.
✅ For Windows Users
- Go to Settings → Apps → Installed Apps.
- Search for Docker Desktop and click Uninstall.
- Manually delete any leftover folders:
C:\ProgramData\DockerC:\Users\<YourUsername>\.docker
✅ For macOS Users
- Open Finder → Applications → Docker.app and drag it to the trash.
- Open Terminal and run:
bashCopyEditrm -rf ~/.dockersudo rm -rf /Library/Containers/com.docker.dockersudo rm -rf /Library/Application\ Support/Docker\ Desktop
📝 Final Thoughts
Removing Docker isn't just about uninstalling the software. To avoid conflicts later, it's essential to clear Docker data and configurations as well. With this guide, you’ll ensure your system is clean, whether you're planning a fresh reinstall or moving away from Docker entirely.