Let’s see the steps to uninstall docker on ubuntu 20.04/22.04 LTS.


Uninstalling Docker from your Ubuntu 20.04 or 22.04 LTS system can become necessary for various reasons, whether you need to clear space on your machine, replace it with another containerization tool, or troubleshoot issues. In this guide, we’ll walk you through the steps to safely and efficiently remove Docker and its associated components from your Ubuntu Long Term Support (LTS) installation. Follow these straightforward instructions to ensure a clean and hassle-free uninstallation process.

Note: These instructions will remove Docker completely, including all containers and images. Be sure to backup any data you want to keep from your Docker containers before proceeding.

Steps to Uninstall Docker on ubuntu 20.04/22.04 LTS

Step #1: Stop and Disable Docker

First, stop the Docker service and disable it from starting on boot:

ubuntu@Rushi-InfoTech:~$ sudo systemctl stop docker
ubuntu@Rushi-InfoTech:~$ sudo systemctl disable docker

Step #2: Remove Docker Packages

To remove Docker packages, including docker-ce, docker-ce-cli, and containerd.io, you can use the following command:

ubuntu@Rushi-InfoTech:~$ sudo apt purge -y docker-ce docker-ce-cli containerd.io

Step #3: Remove Docker Files and Directories

To remove any Docker-related files and directories (including containers and images), you can use the following commands:

ubuntu@Rushi-InfoTech:~$ sudo rm -rf /var/lib/docker
ubuntu@Rushi-InfoTech:~$ sudo rm -rf /etc/docker

Step #4: Remove Docker Group (Optional)

If you previously added your user to the docker group, and you no longer plan to use Docker, you can remove the group:

ubuntu@Rushi-InfoTech:~$ sudo deluser <your-username> docker

Replace <your-username> with your actual username.

Step #5: Verify the Docker on server

  • Please verify the presence of Docker on Ubuntu 20.04/22.04 LTS.
ubuntu@Rushi-InfoTech:~$ docker --version
  • Please verify the Docker service and it’s status.
ubuntu@Rushi-InfoTech:~$ sudo systemctl status docker


Removing Docker from your Ubuntu 20.04 or 22.04 LTS system is a simple task. By following the appropriate commands and steps, you can safely uninstall Docker and its associated components to free up resources or prepare for a fresh installation of a different version or containerization tool. Always remember to back up any essential Docker containers or data before proceeding with the uninstallation process to avoid any data loss.

Please visit the official website of Docker.

Any queries pls contact us

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *