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 (1)
If you are looking for something similar, podman or podman desktop aren't bad. Failing that, orbstack.