๐Ÿณ How to Completely Remove Docker from Your System

๐Ÿณ 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 -y
sudo rm -rf /var/lib/docker
sudo 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-plugin
sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd

๐Ÿ› ๏ธ You might also want to clean up leftover config files in /etc/docker/.


โœ… For Windows Users

  1. Go to Settings โ†’ Apps โ†’ Installed Apps.
  2. Search for Docker Desktop and click Uninstall.
  3. Manually delete any leftover folders:
    • C:\ProgramData\Docker
    • C:\Users\<YourUsername>\.docker

โœ… For macOS Users

  1. Open Finder โ†’ Applications โ†’ Docker.app and drag it to the trash.
  2. Open Terminal and run:

bashCopyEditrm -rf ~/.docker
sudo rm -rf /Library/Containers/com.docker.docker
sudo 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.

Read more