OneBite.Dev - Coding blog in a bite size

uninstall docker

Simple docker step by step how to uninstall docker with explanation

Docker, while crucial for developers, might sometimes need to be uninstalled for various reasons. This article provides simple, step by step instructions on how to uninstall Docker from your system.

First Step: Stop Docker Services

To begin with, you need to ensure that Docker’s services are no longer running. Run the following commands in your terminal:

sudo service docker stop

This command will halt all Docker services.

Second Step: Remove Docker Packages

After stopping Docker services, you can proceed to remove the packages. To uninstall Docker, use the following command:

sudo apt-get purge docker-ce docker-ce-cli containerd.io

This command will uninstall Docker from your system.

Third Step: Remove Docker Directories

Even after uninstalling Docker, some Docker directories might remain on your system. So, the next move is to delete those directories. Here’s how:

sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd

These commands will thoroughly remove Docker directories from your system.

Final Step: Check Docker Uninstallation

Finally, to verify that Docker is no longer present in your system, you can utilize the following command:

docker

If Docker has been successfully uninstalled, this command will return an error message because Docker command can no longer be recognized in your system.

Remember, Docker’s uninstallation might affect your projects’ environment, so make sure to back up any necessary configurations or settings before you proceed. Following these simple steps, you can easily uninstall Docker from your system.

docker