If you’ve been messing around with Docker for a while, chances are your system has turned into a junkyard of old containers, images, and volumes you don’t even remember creating. Docker is amazing, but it’s also a hoarder by default.
And let’s be honest. if you’re using Docker Desktop, especially on Mac or Windows, that bloated piece of software is probably eating your RAM for breakfast. My honest advice: uninstall Docker Desktop.
- On Mac/Linux and you still want a GUI? → Check out OrbStack. Way lighter, way faster.
- Or, better yet: learn the CLI like a seasoned dev. Once you get comfortable, it feels way cleaner and faster.
Now, let’s talk about how to completely clean up Docker.
👉 I recommend doing this weekly if you’re a heavy Docker user, or at least twice a month to keep things fresh.
🐳 Docker Cleanup (Purge Everything)
This will clear out unused containers, images, networks, volumes, and if you want, completely nuke Docker’s system files.
1. Soft Cleanup (recommended)
The easiest, safest way to clear unused junk:
docker system prune -a --volumes
-
-a
: removes all unused images (not just dangling ones). -
--volumes
: removes unused volumes too.
Think of this as Docker’s version of spring cleaning.
(Run this once a week, and Docker won’t ever balloon out of control.)
2. Stop and Remove All Containers
Sometimes you just want a fresh start:
docker stop $(docker ps -aq)
docker rm $(docker ps -aq)
3. Remove All Images, Volumes, and Networks
Go full “factory reset” mode on your Docker resources:
docker rmi -f $(docker images -aq)
docker volume rm $(docker volume ls -q)
docker network rm $(docker network ls -q)
4. (Optional) Completely Reset Docker
⚠️ Warning: this wipes Docker’s entire state, including cached layers.
sudo systemctl stop docker
sudo rm -rf /var/lib/docker /var/lib/containerd
sudo systemctl start docker
Keeps things lean and mean.
TL;DR
- Ditch Docker Desktop → Use OrbStack (Mac) or CLI (Linux).
- Run
docker system prune -a --volumes
once a week (or at least twice a month). - Reset Docker fully only if things are really broken.
Your future self (and your SSD) will thank you.
Top comments (0)