OneBite.Dev - Coding blog in a bite size

uninstall docker on mac

Simple docker step by step how to uninstall docker on mac with explanation

Uninstalling Docker on a Mac can be done with a few simple steps. This article provides a step-by-step tutorial on how to do this.

Preparation

Before we start, ensure you have saved any valuable data associated with your Docker instances. Uninstalling Docker will erase all your Docker containers and images.

Step 1: Quit Docker Desktop

Firstly, you need to quit Docker Desktop. Find the whale icon in the top bar of your mac, click on it, and select “Quit Docker Desktop” from the drop-down menu.

Step 2: Run the Uninstall Script

After Docker has been quit, it’s time to run the Docker uninstall script. For this, open Terminal and run the following command:

/Applications/Docker.app/Contents/MacOS/Docker --uninstall

This script will delete the Docker app from the Applications folder of your mac, and remove all files associated with Docker from your system.

Step 3: Remove Docker Files

Even after running the uninstall script, there might be files left in your Home directory associated with Docker. Run the following commands to delete them:

rm -Rf ~/Library/Containers/com.docker.docker
rm -Rf ~/Library/Application\ Scripts/com.docker.helper
rm -Rf ~/Library/Group\ Containers/group.com.docker

Step 4: Recheck

The last step is to make sure that Docker is completely removed from your system. Check your Applications folder to ensure Docker app is gone. Also, open Terminal and type “Docker”. You should receive a message stating “command not found”.

You have now successfully uninstalled Docker from your Mac. You can proceed with whatever subsequent steps you had in mind, whether that’s a clean reinstallation of Docker or freeing up space on your Mac machine. Please remember to restart your machine to ensure all changes are properly implemented.

docker