Safe, explain-first Docker disk usage inspector and cleanup tool
Project description
Docker Disk Doctor
Docker Disk Doctor is a safe, explain-first CLI tool that shows how Docker is using disk space and what is safe to clean — without blindly running docker system prune.
Built from real homelab and infrastructure pain.
Why this exists
Docker is great… until your disk suddenly fills up.
At that point, most people run:
docker system prune -a
…and hope for the best.
Docker Disk Doctor exists to answer one simple question before you delete anything:
What exactly is using my disk space, and what is safe to remove?
This tool is safe-by-default.
It explains first — you decide what to clean.
Features
- Full breakdown of Docker disk usage:
- Images (used vs unused)
- Containers (running vs stopped)
- Volumes (attached vs orphaned)
- Actual disk usage (MB / GB)
- Clear, readable CLI tables
- Safe-by-default cleanup (nothing is deleted unless you explicitly confirm)
- Designed for homelabs, servers, and real systems
Screenshot
Click to expand example output
Installation
Prerequisites
You need pipx.
On most Debian / Ubuntu systems:
sudo apt update
sudo apt install -y pipx
pipx ensurepath
After
pipx ensurepath, open a new terminal (or log out/in) so your PATH updates.
Install Docker Disk Doctor
pipx install docker-disk-doctor
This installs the dockerdoctor command (and also docker-disk-doctor).
Docker permission note (important)
If you get a Permission denied error to /var/run/docker.sock, your user likely can't access Docker.
Fix it with:
sudo usermod -aG docker $USER
Then log out and back in, and verify:
docker ps
Once docker ps works, Docker Disk Doctor will work.
Usage
Show disk usage breakdown (default)
dockerdoctor
(or)
docker-disk-doctor
Cleanup (optional)
Docker Disk Doctor is safe-by-default.
Nothing is deleted unless you explicitly confirm it.
Preview cleanup (dry-run)
dockerdoctor test clean all
You can also preview specific targets:
dockerdoctor test clean images
dockerdoctor test clean volumes
Apply cleanup
dockerdoctor clean all --yes
Or target specific resources:
dockerdoctor clean images --yes
dockerdoctor clean volumes --yes
The
--yesflag is required to prevent accidental data loss.
Safety guarantees
- No automatic deletions
- No force-removal by default
- No surprises
- Docker may refuse to delete resources still in use — those are skipped safely
Support
If this tool saved you time, stress, or disk space,
consider buying me a compute ☕
https://buymeacoffee.com/revdal
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file docker_disk_doctor-0.3.1.tar.gz.
File metadata
- Download URL: docker_disk_doctor-0.3.1.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
098f864789651318249012e97e8594e96429b296d578492791ed4ab9ed45ee15
|
|
| MD5 |
d7b61b4c0198fcf72df9095585195f06
|
|
| BLAKE2b-256 |
f01ec4930687f300aa5a72e7ed491b2cad93334a6a49c48dd97371e8bc1f1fbc
|
File details
Details for the file docker_disk_doctor-0.3.1-py3-none-any.whl.
File metadata
- Download URL: docker_disk_doctor-0.3.1-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db4092d8b0c3c9a9d83886a47a7ac65b3450ec42db4843d357c263577f0843f3
|
|
| MD5 |
bc3981e868d974ce50e52187a0288c78
|
|
| BLAKE2b-256 |
d29242391fc50f81f7728a3f35041023e9dd4fc2c8ad64a3413c5ee8dfaeb99e
|