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.
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
Want to nuke all containers, images, and volumes?
docker system prune -a --volumes --force
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
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
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
Remove the keyrings directory if it was created just for Docker:
sudo rm -rf /etc/apt/keyrings/
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
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'
If both commands fail, congratulations! Docker is history.
Bonus: Remove Docker Groups and Users (Optional)
To remove the Docker group:
sudo groupdel docker
If you had a dedicated Docker user (rare case), you can delete it:
sudo userdel docker
Step 7: Reboot (Optional but Recommended)
Sometimes services linger in memory. Reboot to make sure everything is cleared:
sudo reboot
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:
- Stop and remove containers:
docker system prune -a --volumes --force
- Purge Docker:
sudo apt-get purge -y docker*
- Remove Docker files:
sudo rm -rf /var/lib/docker /etc/docker ~/.docker
- Clean up packages:
sudo apt-get autoremove -y --purge docker*
- Verify:
docker --version
(should fail) - Reboot:
sudo reboot
That’s it. Docker is out. No regrets.
Top comments (9)
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"... 🤔
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!
But docker is there to remove the it works if my machine nonsense?
You're right,
Docker simplifies things significantly. However, exploring alternatives like Podman can sometimes offer benefits in certain use cases.
If you are looking for something similar, podman or podman desktop aren't bad. Failing that, orbstack.
Thanks for the recommendations! I'll check out Podman Desktop and OrbStack too, good to have alternatives handy
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.
For over a decade docker has been the single best and consistent tool in my toolbox. No I'm not uninstalling it.
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 :)