DEV Community

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

Posted on

10 1 1 2

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.

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (9)

Collapse
 
jesse_grobstein_7214fd932 profile image
Jesse Grobstein

It sounds like you're not using docker correctly. You should take some time and RTFM. On the other hand, I prefer podman, it is a replacement for docker, it runs all my docker containers without the overhead of docker on my machine. Again, "podman" runs "containers"... 🤔

Collapse
 
eddiegulay profile image
Eddie Gulay

Thanks for the tip! You're right—Podman does have advantages, especially the reduced overhead. I’ll definitely take a closer look at Podman. Appreciate the suggestion!

Collapse
 
sc7639 profile image
Scott Crossan

But docker is there to remove the it works if my machine nonsense?

Collapse
 
eddiegulay profile image
Eddie Gulay

You're right,
Docker simplifies things significantly. However, exploring alternatives like Podman can sometimes offer benefits in certain use cases.

Collapse
 
darkflib profile image
Mike Preston

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

Collapse
 
eddiegulay profile image
Eddie Gulay

Thanks for the recommendations! I'll check out Podman Desktop and OrbStack too, good to have alternatives handy

Collapse
 
coeal1 profile image
Ian

Podman is an alternative engine to run containers and minikube is a minimal distribution of Kubernetes of which the primary objective is to orchestrate running containers. Minikube in particular is exponentially more complex given its intent and capabilities. Saying those two tools can be considered for container-free virtualization is downright inaccurate as their sole purpose is for the running of containers.

Collapse
 
c_k_c6c7156c1f991203855d0 profile image
C K

For over a decade docker has been the single best and consistent tool in my toolbox. No I'm not uninstalling it.

Collapse
 
eddiegulay profile image
Eddie Gulay

Totally understandable!, Docker has indeed proven itself reliable and powerful. No pressure to switch—use whatever keeps your workflow smooth.
i ended up re-installing it again :)

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay