DEV Community

Cover image for Fed Up with Docker? Here, Uninstall It Completely (No Coming Back!)
Eddie Gulay
Eddie Gulay

Posted on

Fed Up with Docker? Here, Uninstall It Completely (No Coming Back!)

Docker is a fantastic tool... until it isn’t. Maybe you're tired of mysterious container issues, endless rebuilds, or "it works on my machine" nightmares. Whatever the reason, you’ve reached the breaking point and decided to part ways with Docker. You don’t just want it gone — you want it obliterated from your system with no trace left behind.

If that sounds like you, this guide is your salvation. We’re not going to sugarcoat it. This post is about getting rid of Docker once and for all. Let’s dive in.


Why Uninstall Docker?

  • Bloated disk usage from dangling images and unused volumes.
  • Frequent conflicts and compatibility issues.
  • Frustration with complex configurations.
  • Seeking alternatives that better fit your workflow.

Image description

Whatever the reason, you're here to uninstall Docker, so let's not waste time.

Step 1: Stop and Remove Running Containers

Before you rip Docker out, you need to stop any running containers:

docker ps -q | xargs -r docker stop
Enter fullscreen mode Exit fullscreen mode

Want to nuke all containers, images, and volumes?

docker system prune -a --volumes --force
Enter fullscreen mode Exit fullscreen mode

Warning: This wipes out all your Docker data. If you're sure you never want to see it again, go for it.

Step 2: Uninstall Docker (Ubuntu/Linux)

Docker doesn’t just live in one place. It scatters components all over your system. Here’s how to find them all and remove them.

Purge Docker Packages

Remove Docker and its related components:

sudo apt-get purge -y docker-engine docker docker.io docker-ce docker-ce-cli containerd runc
Enter fullscreen mode Exit fullscreen mode

Step 3: Clean Up Residual Files

Docker leaves behind configuration files and volumes. Nuke them with:

sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd
sudo rm -rf /etc/docker
sudo rm -rf ~/.docker
Enter fullscreen mode Exit fullscreen mode

This ensures no leftover Docker data is hiding in your system.

Step 4: Remove Docker Repositories and Keys

Get rid of Docker’s repository entries and GPG keys:

sudo rm /etc/apt/sources.list.d/docker.list
sudo rm -rf /etc/apt/keyrings/docker.gpg
Enter fullscreen mode Exit fullscreen mode

Remove the keyrings directory if it was created just for Docker:

sudo rm -rf /etc/apt/keyrings/
Enter fullscreen mode Exit fullscreen mode

Step 5: Autoremove and Clean Packages

Run these commands to clean any orphaned packages:

sudo apt-get autoremove -y --purge docker docker-ce docker-ce-cli
sudo apt-get clean
Enter fullscreen mode Exit fullscreen mode

Step 6: Verify Docker is Gone

Let’s make sure Docker is truly out of your life:

docker --version  # Should return 'command not found'
docker-compose --version  # Should also return 'command not found'
Enter fullscreen mode Exit fullscreen mode

If both commands fail, congratulations! Docker is history.

Bonus: Remove Docker Groups and Users (Optional)

To remove the Docker group:

sudo groupdel docker
Enter fullscreen mode Exit fullscreen mode

If you had a dedicated Docker user (rare case), you can delete it:

sudo userdel docker
Enter fullscreen mode Exit fullscreen mode

Step 7: Reboot (Optional but Recommended)

Sometimes services linger in memory. Reboot to make sure everything is cleared:

sudo reboot
Enter fullscreen mode Exit fullscreen mode

While sipping monster energy ...

Docker had its moment, but you’re done. With the steps above, you’ve not only uninstalled Docker — you’ve wiped every trace of it from your machine. No coming back. No lingering configs. No haunted volumes.

Thinking of alternatives? Check out tools like Podman, Minikube, or Vagrant for container-free virtualization. Or maybe take a break from containerization altogether. You’ve earned it.

Goodbye, Docker. It was... something.

TL;DR:

  1. Stop and remove containers: docker system prune -a --volumes --force
  2. Purge Docker: sudo apt-get purge -y docker*
  3. Remove Docker files: sudo rm -rf /var/lib/docker /etc/docker ~/.docker
  4. Clean up packages: sudo apt-get autoremove -y --purge docker*
  5. Verify: docker --version (should fail)
  6. Reboot: sudo reboot

That’s it. Docker is out. No regrets.

Top comments (1)

Collapse
 
darkflib profile image
Mike Preston

If you are looking for something similar, podman or podman desktop aren't bad. Failing that, orbstack.