How to Uninstall Docker (Windows/Mac/Linux)

How to Uninstall Docker (Windows/Mac/Linux)

Docker is the leading containerization platform that simplifies the deployment and administration of applications.

However, there are situations where you might want to uninstall Docker, such as concerns over its licensing terms, which have raised issues about potential costs and compliance for some organizations.

This has prompted users to look for alternative container platforms.

Let’s go through how to uninstall Docker on Windows, Mac, and Linux.

Uninstall Docker on Widows

To uninstall Docker on Windows, you can follow these steps:[1][2]

  1. First, let’s remove all Docker containers, images, and networks created or used by Docker:
    • To stop all running containers, run this command in a CMD prompt or Powershell terminal: docker stop $(docker ps -a -q)
    • To delete all containers, images, and networks, run this command: docker system prune -a
  2. Next, go to the Windows Start menu, search for “Add or remove programs” and open it.
  3. Find “Docker Desktop” in the list of installed applications then click the “Uninstall” button.
  4. You can optionally remove any lingering files and folders that Docker may leave such as its installation directory which is C:\ProgramData\Docker by default.
  5. Docker for Windows may have enabled Hyper-V and related features. To disable these features, you can open “Control Panel,” navigate to “Programs and Features,” click on “Turn Windows features on or off,” and then uncheck the features related to Hyper-V and virtualization.

After uninstalling Docker and disabling related features, it’s a good idea to reboot your computer.

Uninstall Docker on Mac

To uninstall Docker on Mac, you can follow these steps:[3]

  1. First, let’s remove all Docker containers, images, and networks created or used by Docker:
    • To stop all running containers, run this command in a CMD prompt or Powershell terminal: docker stop $(docker ps -a -q)
    • To delete all containers, images, and networks, run this command: docker system prune -a
  2. Click on the “Docker Desktop” icon in the menu bar and select “Quit Docker Desktop” to stop the Docker application.
  3. Open Finder, go to your Applications folder, and find “Docker”. Drag the Docker application to the Trash.
  4. Docker may leave behind some data, including containers, images, and configurations. To remove this data, open Terminal and run the following commands:
    • rm -rf ~/.docker
    • rm -rf ~/Library/Containers/com.docker.docker
  5. If you’ve set up shell completions for Docker (e.g., using Zsh or Bash), you can remove them by deleting the relevant configuration files. For example, if you’re using Zsh, you might remove the Docker completions with: rm -f ~/.zsh/completion/_docker

It’s a good practice to restart your Mac at this point.

Uninstall Docker on Linux

The exact steps to uninstall Docker on Linux can vary depending on your Linux distribution. Here are general instructions for some common Linux distributions: Ubuntu, CentOS, and Fedora. Be sure to adapt these commands to your specific distribution:[4][5]

  1. First, let’s remove all Docker containers, images, and networks created or used by Docker:
    • To stop all running containers, run this command in a CMD prompt or Powershell terminal: docker stop $(docker ps -a -q)
    • To delete all containers, images, and networks, run this command: docker system prune -a
  2. Uninstall Docker’s packages:
    • For Ubuntu: sudo apt-get remove docker-ce docker-ce-cli containerd.io
    • For CentOS: sudo yum remove docker-ce docker-ce-cli containerd.io
    • For Fedora: sudo dnf remove docker-ce docker-ce-cli containerd.io
  3. To remove all Docker-related configuration files, you can use the following command:
    • sudo rm -rf /var/lib/docker
  4. To ensure there are no remaining Docker files or directories, run:
    • sudo rm -rf /etc/docker

References

  1. “Uninstall docker desktop.” (2023, December 5). Docker Documentation. https://docs.docker.com/desktop/uninstall/ ↩︎
  2. Ariel. (2023, November 3). How to Uninstall Docker from Windows/Mac Completely? [Full Guide] – MiniTool Partition Wizard. MiniTool. https://www.partitionwizard.com/partitionmagic/uninstall-docker.html ↩︎
  3. Lanman, J. (2023, July 4). How to safely uninstall Docker desktop from a Mac. MUO. https://www.makeuseof.com/how-to-uninstall-docker-desktop-mac/ ↩︎
  4. Nek, D. (2023, October 18). How to uninstall Docker on Ubuntu. Linux Tutorials for Beginners. https://webhostinggeeks.com/howto/how-to-uninstall-docker-on-ubuntu/ ↩︎
  5. Uninstall Docker from Linux (CentOS 7, RedHat 7). (n.d.). https://www.learn-it-with-examples.com/development/virtualization/docker/uninstallation-docker-from-linux.html ↩︎
Published