Free up disk space used by Docker
Docker keeps old images, stopped containers and logs on your server’s disk. Over time they fill it. This page shows how to see what uses the space and how to clean it up safely. If your disk is already full, go to When the disk is full. To stop it filling again, see Keep the disk from filling again.
Before you start
Section titled “Before you start”- You finished all Prerequisites steps. Docker > Disk Usage and Cleanup need only that, on any license. If a step is missing, Deployrr shows a Requirements Not Met box that says “Prerequisites - All steps must be completed”. See the Quick start.
- Make a backup of your Docker folder before a cleanup that removes volumes or all containers. Tools > Backups needs a Pro license (“License - Pro required.”). A backup stops all your running containers first.
- Some steps use Stack Manager. It needs a Basic, Plus or Pro license.
When the disk is full
Section titled “When the disk is full”A full disk shows up in a few ways. These are general Docker and Linux behavior:
no space left on devicein an app’s log, in an image pull or in an update.- Apps stop or won’t start.
- Databases fail to write.
1. Find which disk is full
Section titled “1. Find which disk is full”-
Run this:
Terminal window df -h -
Look for a line at or near
100%in theUse%column.
Docker keeps its data in /var/lib/docker by default. Your app files are in the Docker folder you chose in Prerequisites. These can be on different disks. Free space on the disk that is full.
2. Free some space
Section titled “2. Free some space”Go in this order. The safest options come first. Check df -h after each one and stop when you have enough room.
-
Docker cleanup. Run Docker > Cleanup. See Clean up with the Docker menu.
-
Container logs. Find the big ones. With the aliases, run
dlogsize. The long form is in Container logs. The output shows the path of each log file. To empty a huge log and keep the file, replace/path/to/the-container-json.logwith a path from that output:Terminal window sudo truncate -s 0 /path/to/the-container-json.log -
Traefik logs. Use the same
truncatecommand onaccess.logandtraefik.loginlogs/HOSTNAME/traefik/in your Docker folder. See Read Traefik logs. -
Old backups. Go to Tools > Backups > Delete. This needs a Pro license. Pick the backup location, then one backup file. In the Delete Backups box, No is selected first; choose Yes to delete. Repeat for each file. See Back up and restore your Docker folder. Don’t make a new backup while the disk is full. A backup needs free space and stops all your apps.
-
System journal. This is general Linux. Check its size, then shrink it:
Terminal window sudo journalctl --disk-usageTerminal window sudo journalctl --vacuum-size=200M -
Package cache. On Debian or Ubuntu:
Terminal window sudo apt clean
3. Bring your apps back
Section titled “3. Bring your apps back”-
Go to Tools > Stack Manager > Up. This needs a Basic, Plus or Pro license. See Stack Manager.
-
On any license, list your containers to see which ones stopped:
Terminal window sudo docker ps -a -
Read the log of each app that is not running:
Terminal window sudo docker logs APPReplace
APPwith the container name.
Then follow Check it worked.
See what Docker uses
Section titled “See what Docker uses”- In Deployrr, open Docker from the main menu.
- Select Disk Usage (“View Docker Disk Usage”).
- Wait for “Disk usage report complete”.
Deployrr prints a detailed report. It lists your images, containers, local volumes and build cache, with the size of each. Look at the RECLAIMABLE column in the summary. It shows how much space a cleanup could free.
If you installed the bash aliases, ddf shows the short summary. The long form is:
sudo docker system dfClean up with the Docker menu
Section titled “Clean up with the Docker menu”This is the safe option. It never removes volumes.
- Open Docker from the main menu.
- Select Cleanup (“Prune Unused Docker Data”).
- Read the Docker Cleanup box. It says it will remove:
- All stopped containers.
- All networks not used by at least one container.
- All dangling images.
- All dangling build cache.
- Select Yes to continue. Yes is selected by default. Select No to stop without changes.
- Wait. Deployrr says “This may take a few minutes…”.
- Look for “Docker system prune complete”.
- Read the updated disk usage that Deployrr prints, then wait for “Cleanup complete”.
The box says “This is safe for running containers and will free up disk space.” Running containers are not touched. Your app files in the Docker folder are not touched either. This menu option never removes volumes.
A dangling image is an image with no name that nothing uses. After you update your apps, the old version of each image often becomes dangling. This cleanup removes those. This is general Docker behavior, as is the RECLAIMABLE column in the usage report.
If you stopped an app, Cleanup removes its container. Its settings stay in your Docker folder. Open Tools > Stack Manager > Up to create the container again. Start Container only lists containers that still exist, so a removed one is not in its list. If no stopped container is left at all, it prints “No exited containers found.”
Pick a cleanup alias
Section titled “Pick a cleanup alias”If you installed the bash aliases, you have more cleanup aliases. They are stronger than the menu option. Each alias below shows its long form, which works without the aliases.
To see how the cleanup aliases work in a manual setup, watch Bash aliases video: Docker cleanup aliases at 9:38 (manual Docker Compose setup; alias names and behavior can differ from Deployrr). For the matching commands, read UDMS part 13: System cleanup commands for Docker (manual setup, for background only).
| Alias | Long form | What it removes |
|---|---|---|
ddf |
sudo docker system df |
Nothing. It shows disk use. |
dstopall |
sudo docker stop $(sudo docker ps -aq) |
Nothing. It stops every container. derase runs it first. |
dlogsize |
See below | Nothing. It shows container log sizes. |
dprunesys |
sudo docker system prune -a |
Stopped containers, unused networks and all images that no container uses. It does not remove volumes. It asks you to confirm. |
dprunevol |
sudo docker volume prune |
Volumes that no container uses. It asks you to confirm. |
ddelimages |
sudo docker rmi $(sudo docker images -q) |
Tries to delete every image. Images that a container uses stay, and Docker prints an error for each. |
drm |
sudo docker rm $(sudo docker ps -a -q) |
Tries to remove every container. Running ones are refused. |
dprune |
ddelimages ; dprunevol ; dprunesys |
All the effects of those three aliases, one after the other. It removes unused volumes. |
derase |
dstopall ; drm ; ddelimages ; dprunevol ; dprunesys |
Stops and removes every container, then every image, then the volumes. |
Which one to use:
- Routine cleanup: use the Cleanup menu option, or
dprunesysif you also want unused images that are not dangling gone. Neither removes volumes. - Unused volumes: run
dprunevolonly after you check what it will remove and have a backup. Newer Docker versions remove only unnamed volumes by default. Older versions remove all unused volumes. Check the list Docker shows before you answer. dprune: the alias file calls it a safe cleanup. It is not safe for volumes, because it runsdprunevol.derase: a full reset. Every app stops and its container is removed. Docker pulls every image again when you bring your apps back, for example with Tools > Stack Manager > Up. That counts against your Docker Hub pull limit. See Docker image pulls fail. Use it only when you want to start from nothing.
The messages ddelimages and drm print for images and containers in use, and the confirmation prompts, are general Docker behavior. In Stack Manager, Down also removes containers.
Other big disk users
Section titled “Other big disk users”Docker images and containers are not the only space users.
Container logs
Section titled “Container logs”If you installed the aliases, dlogsize lists the size of each container’s log file, sorted by size. The long form is:
sudo du -ch $(sudo docker inspect --format='{{.LogPath}}' $(sudo docker ps -qa)) | sort -hTraefik logs
Section titled “Traefik logs”Traefik writes traefik.log and access.log to logs/HOSTNAME/traefik/ in your Docker folder. Deployrr does not rotate them, so they grow over time. See Read Traefik logs. To see their size, run this from your Docker folder. This is a general check:
ls -lh logs/$HOSTNAME/traefik/Backups
Section titled “Backups”Each backup is a full copy of your Docker folder. Old ones add up. Open Tools > Backups to see Number of Backups and Size of Backups. Use Delete to remove old ones. See Back up and restore your Docker folder.
Your whole disk
Section titled “Your whole disk”These are general Linux checks. The first shows free space on each disk. The second shows the size of your Docker folder. Replace YOUR_DOCKER_FOLDER with the path to your Docker folder.
df -hsudo du -sh YOUR_DOCKER_FOLDERIf you installed the bash aliases, these help you find big items. Run them from the folder you want to look at:
| Alias | Long form | What it shows |
|---|---|---|
dirsize |
sudo du -hx --max-depth=1 |
The size of each folder one level down. |
space |
du -sh * | sort -hr |
Items in the current folder, largest first. |
biggest |
find . -type f -printf "%s %p\n" | sort -nr | head -10 |
The 10 largest files under the current folder. |
If cleaning up is not enough, move your media or Docker’s storage to a bigger disk. See Move your media or Docker data to another disk.
Keep the disk from filling again
Section titled “Keep the disk from filling again”Install Docker Garbage Collection
Section titled “Install Docker Garbage Collection”Docker Garbage Collection (“Docker GC”) cleans up unused Docker images, containers and volumes on a schedule. In Apps > Browse Apps it is listed as “Docker Garbage Collection - Docker garbage collection”.
Before you start:
- You finished Prerequisites.
- You have a Basic, Plus or Pro license. See Licenses. Installing apps needs one.
- Socket Proxy is installed and running. You install it from Docker > Socket Proxy.
To install it:
- Go to Apps > Browse Apps.
- Select Docker Garbage Collection and press Install.
- In the Install Docker Garbage Collection box (“Do you want to install this app?”), choose Yes.
Docker GC asks no other questions. Deployrr prints four steps and ends with “Docker Garbage Collection installation complete!”.
If the terminal shows Required app not running with [REQUIRED] socket-proxy must be installed and running first, install or start Socket Proxy, then install again. It works the same way as for DeUnhealth. See Requirements Not Met for other boxes.
Docker GC has no web page and no Traefik entry. If you set up the Deployrr Dashboard, it shows in the Apps (Others) section, with no link.
What it does by default
Section titled “What it does by default”These are the settings in its compose file, compose/HOSTNAME/docker-gc.yml in your Docker folder:
| Setting | Value | Meaning |
|---|---|---|
CRON |
0 0 0 * * ? |
Written as a daily midnight schedule. It currently never runs. See Make it run every night. |
GRACE_PERIOD_SECONDS |
604800 |
Keeps things for 7 days before removal. |
FORCE_IMAGE_REMOVAL |
1 |
Forces the removal of unused images. |
FORCE_CONTAINER_REMOVAL |
0 |
Does not force the removal of containers. |
CLEAN_UP_VOLUMES |
1 |
Removes unused volumes. |
DRY_RUN |
0 |
Does the removal for real. |
A Docker GC run removes containers that exited more than 7 days ago, images that no container uses, and unused volumes. This is how the image behaves, not something Deployrr adds. To understand how a garbage collector works in a manual setup, read UDMS part 14: Docker Garbage Collector (manual setup, for background only; Deployrr v6 runs it through Socket Proxy with the settings above).
Make it run every night
Section titled “Make it run every night”The image reads CRON as a normal 5-part schedule: minute, hour, day of month, month, day of week. The schedule in the compose file currently has 6 parts, so the third 0 lands on the day of month, and there is no day 0. The job currently never starts. Set a 5-part schedule yourself:
-
Make a copy of the compose file. Run this from your Docker folder, and replace
HOSTNAMEwith your server’s hostname:Terminal window cp compose/HOSTNAME/docker-gc.yml ~/docker-gc.yml.bak -
Open
compose/HOSTNAME/docker-gc.ymland change theCRONline to:- CRON=0 0 * * *This runs every day at midnight.
0 3 * * 0runs Sundays at 3 AM. Keep the line’s indent as it was. -
Decide on volumes before the first run. To keep unused volumes, set
CLEAN_UP_VOLUMES=0. Images and old containers are still cleaned. -
Save the file.
-
Go to Tools > Stack Manager > Recreate. In the numbered list, pick
docker-gc. -
Check the schedule the container uses:
Terminal window sudo docker exec docker-gc crontab -lThe line should start with
0 0 * * *. -
After the next scheduled time, read its log:
Terminal window sudo docker logs docker-gcA run starts with “Docker GC starting.” and ends with “Docker GC has completed.” If you see neither, the schedule didn’t match. Check the
CRONline again.
Change what it removes
Section titled “Change what it removes”Edit the same file, save it and recreate docker-gc as in the steps above.
- Keep things longer: raise
GRACE_PERIOD_SECONDS.1209600is 14 days. - Keep unused volumes: set
CLEAN_UP_VOLUMES=0. - Keep an image: add it to
appdata/docker-gc/docker-gc-excludein your Docker folder, one per line. Use the name and tag, likelscr.io/linuxserver/plex:latest, or the 12-character image ID thatsudo docker imagesshows. The file ships with only the Docker GC image in it.
Try a dry run first
Section titled “Try a dry run first”With DRY_RUN=1, Docker GC lists the containers and images it would remove and removes none of them. It still removes unused volumes if CLEAN_UP_VOLUMES is 1. For a dry run that removes nothing, set both:
- DRY_RUN=1 - CLEAN_UP_VOLUMES=0Recreate it and read sudo docker logs docker-gc after the next run. Look for “would have been removed”. When you are happy with the list, set DRY_RUN back to 0, set CLEAN_UP_VOLUMES the way you want and recreate it again.
What a reinstall resets
Section titled “What a reinstall resets”Deployrr writes docker-gc.yml and the exclude file again on every install or reinstall of Docker GC, including Apps > Manage Apps > the app > Manage > Reinstall (shown when the app is stopped). Your CRON fix, other settings and excluded images are lost then, and the schedule stops working again. Keep your own copy of both files (see What overwrites your changes) and put your changes back after a reinstall. Tools > Stack Manager > Recreate keeps your edits.
Limit container log size
Section titled “Limit container log size”Deployrr’s app compose files don’t set a log size limit, except for the Valkey container that SearXNG installs. Docker’s default json-file log driver has no limit either, so a chatty app can fill your disk. This is general Docker behavior.
You can set a limit for all containers in /etc/docker/daemon.json.
-
Open the file:
Terminal window sudo nano /etc/docker/daemon.json -
Add these keys. This keeps up to 3 files of 10 MB per container:
{"log-driver": "json-file","log-opts": {"max-size": "10m","max-file": "3"}} -
Save the file.
-
Restart Docker:
Terminal window sudo systemctl restart docker -
Check that Docker runs:
Terminal window sudo systemctl status docker
The limit applies only to containers created after the change. Recreate your apps with Tools > Stack Manager > Recreate (pick one app, or all). Up doesn’t recreate a container whose compose file didn’t change. Then check one container. Replace CONTAINER with its name:
sudo docker inspect --format '{{.HostConfig.LogConfig}}' CONTAINERThe output shows max-size and max-file.
Traefik logs
Section titled “Traefik logs”Deployrr doesn’t rotate the Traefik logs. Check their size now and then. See Read Traefik logs.
To hear why access logs grow fast, watch Traefik 3 guide: Traefik log settings and access log growth at 35:32 (manual Docker Compose setup; Deployrr does these steps for you).
Check it worked
Section titled “Check it worked”-
Open Docker > Disk Usage again, or run
ddf. -
Compare the RECLAIMABLE numbers with the first report. They should be smaller.
-
Run
df -hand check that free space went up. -
List your containers. Your running apps should still show as running. On any license, run this. If you installed the bash aliases,
dpsdoes the same:Terminal window sudo docker ps -aWith a Basic, Plus or Pro license you can use Tools > Stack Manager > Containers Status instead.

