OneBite.Dev - Coding blog in a bite size

uninstall docker ubuntu

Simple docker step by step how to uninstall docker ubuntu with explanation

Master the simple and effective process of uninstalling Docker in Ubuntu.

Docker can be an extremely useful tool to containerize applications within your operating system. But, if you’re no longer utilizing it, you might want to free up some space by uninstalling Docker from your Ubuntu system. Below is a guide explaining exactly how to do just that.

Pre-checks:

Begin by checking if Docker is installed on your system. Run the following command in your terminal:

sudo docker info

If Docker is installed, this command should list the Docker system information. If Docker is not installed, nothing will appear or an error message will show.

Steps To Uninstall Docker:

1. Remove Docker Packages

First step would be to uninstall Docker packages using the apt-get remove command. You can do this by running:

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

This command will remove Docker but keep the images, containers, volumes, or customized configuration files on your host.

2. Verify Uninstall

Next, you should verify the uninstallation process by checking if Docker Services are still running on your Ubuntu system:

sudo systemctl status docker

If Docker is successfully uninstalled, this command should say that no Docker service was found.

3. Remove Docker Directory

Now, to delete all images, containers, and volumes, use the below command:

sudo rm -rf /var/lib/docker

This will completely remove the Docker directory.

Note: Be cautious with this command as it will permanently delete your images, containers, and volumes.

Conclusion:

By following these instructions, you can efficiently and completely remove Docker from your Ubuntu system. Remember to be sure you no longer need Docker before taking these actions as these steps will permanently delete your Docker work data.

docker