Uninstall Docker Centos: A Step-by-Step Guide

Uninstall Docker Centos

If you are looking to uninstall Docker from your CentOS system, you've come to the right place. In this article, we will walk you through the step-by-step process of removing Docker from your CentOS machine.

Why Uninstall Docker?

There can be various reasons why you may want to uninstall Docker from your CentOS system. It could be due to issues with the current installation, the need to switch to a different containerization platform, or simply because you no longer require Docker for your specific use case.

Whatever the reason may be, this guide will help you uninstall Docker from your CentOS system effectively.

Step 1: Stop Docker Containers

Before removing Docker from your CentOS system, it is crucial to stop all running Docker containers. This ensures that there are no active processes or dependencies that may interfere with the uninstallation process.

To stop all running Docker containers, use the following command in your terminal:

docker stop $(docker ps -a -q)

Step 2: Remove Docker Containers

Once all Docker containers are stopped, you can proceed to remove them from your system. To remove all containers, use the following command:

docker rm $(docker ps -a -q)

This command removes all Docker containers, ensuring a clean environment for the uninstallation process.

Step 3: Uninstall Docker Engine

To uninstall Docker Engine, you need to remove the Docker package from your CentOS system. This can be done using the package manager, yum, with the following command:

sudo yum remove docker-ce

This command will remove the Docker Engine package from your system, including all associated files and configurations.

Step 4: Remove Docker Images

In addition to Docker containers, it is important to remove any Docker images that may have been downloaded or created on your system. To remove all Docker images, use the following command:

docker rmi $(docker images -a -q)

This command removes all Docker images, freeing up disk space on your CentOS system.

Step 5: Clean up Docker Artifacts

To ensure a complete uninstallation of Docker from your CentOS system, it is recommended to clean up any residual artifacts. This includes removing Docker volumes, networks, and other resources.

To remove Docker volumes, use the following command:

docker volume prune

To remove Docker networks, use the following command:

docker network prune

By cleaning up these artifacts, you can ensure a thorough removal of Docker from your CentOS system.


Uninstalling Docker from your CentOS system is a straightforward process that requires a few simple steps. By following this step-by-step guide, you can successfully remove Docker and all related components from your CentOS machine.

If you are interested in learning more about Docker and related topics, check out the following articles:

  1. What Is Docker: Provides an introduction to Docker and its key concepts.
  2. Docker Security Best Practices: Offers insights on securing Docker containers and best practices to follow.
  3. Docker vs Virtual Machine: Compares Docker containers with virtual machines, helping you choose the right technology for your use case.
  4. Managing Secrets in Docker: Explains how to securely manage sensitive data within Docker containers.
  5. Docker Compose Install: Guides you through the installation process of Docker Compose, a tool for defining and running multi-container Docker applications.

By exploring these articles, you can expand your knowledge and deepen your understanding of Docker and its ecosystem.

Remember to follow the steps outlined in this guide to completely uninstall Docker from your CentOS system.

Related video


Can I uninstall Docker from CentOS?

Yes, you can uninstall Docker from CentOS by following the provided step-by-step guide.

How do I stop Docker containers?

Use the command docker stop $(docker ps -a -q) to stop all running Docker containers.

How do I remove Docker containers?

You can remove Docker containers with the command docker rm $(docker ps -a -q).

What command should I use to uninstall Docker Engine?

To uninstall Docker Engine, run sudo yum remove docker-ce in your terminal.

How can I remove Docker images?

Use the command docker rmi $(docker images -a -q) to remove all Docker images.

What should I do after removing Docker containers and images?

Clean up residual artifacts by running docker volume prune to remove volumes and docker network prune to remove networks.

Are there any related articles I can explore?

Absolutely! Check out the articles on Docker basics, container security, Docker vs virtual machines, Docker Compose installation, and managing secrets in Docker.

Is it possible to reinstall Docker on CentOS?

Yes, you can reinstall Docker on CentOS by following the installation instructions provided by Docker.

Can I uninstall Docker without stopping containers?

It is recommended to stop all Docker containers before uninstalling Docker to avoid any issues.

Will uninstalling Docker delete my data?

Uninstalling Docker does not delete your data. However, make sure to backup any important data before proceeding.

Ruslan Osipov
Author: Ruslan Osipov