Close Menu
IOupdate | IT News and Selfhosting
  • Home
  • News
  • Blog
  • Selfhosting
  • AI
  • Linux
  • Cyber Security
  • Gadgets
  • Gaming

Subscribe to Updates

Get the latest creative news from ioupdate about Tech trends, Gaming and Gadgets.

What's Hot
Check your ISP router now: UPnP may be opening ports for devices you never approved

Check your ISP router now: UPnP may be opening ports for devices you never approved

November 30, 2026
Sort Files by Date and Time Using ls command in Linux

Sort Files by Date and Time Using ls command in Linux

November 30, 2026
Fix a Full Docker Disk Without Deleting Your Data

Fix a Full Docker Disk Without Deleting Your Data

November 30, 2026
Facebook X (Twitter) Instagram
Facebook Mastodon Bluesky Reddit
IOupdate | IT News and SelfhostingIOupdate | IT News and Selfhosting
  • Home
  • News
  • Blog
  • Selfhosting
  • AI
  • Linux
  • Cyber Security
  • Gadgets
  • Gaming
IOupdate | IT News and Selfhosting
Selfhosting

Fix a Full Docker Disk Without Deleting Your Data

AndyBy AndyNovember 30, 2026No Comments8 Mins Read
Fix a Full Docker Disk Without Deleting Your Data


Running out of disk space on your home lab can bring your entire Docker setup to a grinding halt. When updates fail and databases lock up, a panicked system prune can spell disaster for your precious data. In this guide, discover how to safely diagnose and reclaim storage on your self-hosted server without accidentally deleting critical family photos or vital application data. Master targeted cleanup techniques, tame runaway container logs, and optimize your Docker storage management like a pro.

Diagnosing Docker Disk Exhaustion

Your server has plenty of RAM. CPU usage looks fine. Then an update fails, a database starts complaining, and Docker tells you there is no space left. A full disk has a talent for making unrelated applications look broken at the same time.

Before you reach for a giant prune command, find out what filled it. Docker stores several kinds of data, and they do not all have the same value. An old build cache can usually be rebuilt. The only copy of your family photos cannot.

Start here: Run the inspection commands first. Do not delete anything inside Docker’s storage directory by hand, and do not prune volumes just because Docker calls them unused.

1. Confirm Which Filesystem Is Full

These commands only inspect storage:

df -h
df -i
docker info --format '{{.DockerRootDir}}'
docker system df -v

Read them together.

  • df -h shows filesystem capacity and free space.
  • df -i checks inodes, the filesystem’s ability to track individual files.
  • DockerRootDir identifies where this Docker engine stores its data.
  • docker system df -v breaks down Docker objects in more detail.

You can run out of inodes while still having free gigabytes. Millions of tiny files deserve a different investigation from one enormous video archive. Do not assume Docker lives on the root filesystem, or that its data directory is always /var/lib/docker. Confirm the path first.

2. Sort the Space Into Useful Categories

Category What it contains How to approach it
Images Application layers downloaded or built Keep the versions needed for current services and rollback
Build cache Material reused by later builds Often reclaimable, at the cost of slower rebuilds
Container writable layers Files written outside mounted storage Inspect before removing the container
Volumes and bind mounts Databases, uploads, configuration, media Treat as application data
Logs Container output and host journal entries Fix rotation and excessive logging

Docker’s usage report is not a complete map of every byte on the host. Bind-mounted files can live elsewhere, and container logs need their own attention.

On a Linux host, a shallow directory-size check helps locate the big folders:

docker_root="$(docker info --format '{{.DockerRootDir}}')"
sudo du -xhd1 "$docker_root"
sudo journalctl --disk-usage

The first command may take time on a busy server. Avoid repeatedly scanning a large disk while it is already struggling. Also check the actual bind-mount paths shown in your Compose files or deployment platform. A media directory under /srv will not become smaller because you cleaned an image cache.

Advanced Troubleshooting for Self-Hosters

3. Check for a Container Writing Into the Wrong Place

Run:

docker ps -a --size

If an application’s writable layer is unexpectedly large, inspect its mount configuration and application settings. It may be writing downloads or uploads to a path that you forgot to mount.

A healthy example is an application writing to /app/uploads with persistent storage mounted at exactly that destination. A broken example is mounting /uploads while the application continues writing to /app/uploads.

Do not “fix” the problem by deleting and recreating the container. First preserve the files from the actual write location and plan the migration to the intended storage path. This is particularly important when the application has been working for months. Working does not prove its data was persistent.

4. Put a Limit on Container Logs

Inspect the logging configuration of one container, replacing CONTAINER_NAME with its real name:

docker inspect --format '{{json .HostConfig.LogConfig}}' CONTAINER_NAME

The json-file logging driver can grow without a size limit unless rotation is configured. For a Compose-managed service, merge this into that service’s existing definition. It is a logging fragment, not a complete Compose file:

services:
  app:
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "3"

This bounds that container’s retained Docker logs to roughly three ten-megabyte files, with some implementation overhead. It does not cap application log files written into a volume.

Validate the Compose file:

docker compose config --quiet

Then, during an appropriate maintenance window, recreate only the affected service:

docker compose up -d --no-deps --force-recreate app

Confirm the service’s persistent data is mounted before doing this. Recreation removes the old container’s writable layer and can briefly interrupt the service. For an application managed by Coolify or another platform, make the change in that platform’s supported configuration and redeploy there. Avoid creating a second, competing deployment from the host terminal. Changing the daemon’s default logging settings alone does not retroactively change existing containers.

5. Reclaim Disposable Space Deliberately

Once you know the cause, choose a narrow cleanup. Inspect dangling images:

docker image ls --filter dangling=true

If they are no longer needed, remove that category with the confirmation prompt intact:

docker image prune

For old build cache:

docker builder prune --filter "until=168h"

That example targets eligible cache older than a week. Review the prompt before agreeing. The next build may take longer.

Keep a known working application image available while you validate an upgrade. An aggressively cleaned server with no useful rollback version can turn a small problem into an evening project.

“Unused volume” means no current container references it. It does not mean the contents are unimportant. A removed application can leave its only database copy in an unused volume.

If you have almost no free space left, pause new deployments and large imports. Reduce the activity that is still generating files. Look for one clearly identified, disposable item: an old build cache, a duplicate download, or a local backup whose independent copy you have already verified. Reclaim enough room to work, then address the underlying cause.

Avoid deleting active Docker log files, database files, or random directories under Docker’s root. Those are managed by the application or Docker engine. If inodes are exhausted, identify the directory producing huge numbers of small files. Freeing one large image may barely affect the problem.

6. Confirm That the Applications Recovered

Repeat the capacity checks and test the services that failed:

df -h
df -i
docker system df
docker ps

Then perform a real action in each affected application: open an existing record, upload a small file, or complete a harmless test request. Check logs for continuing write errors. A database that failed while the disk was full may need more attention than a container restart.

Finally, set a capacity alert early enough to act. A sensible threshold depends on growth rate: ten gigabytes free means something different on a quiet server than on a box importing camera footage. The useful outcome is a known cause, recovered services, and a limit or alert that prevents the same surprise.

Pro-Tip for Self-Hosters: Modern tools like Homepage or Uptime Kuma can integrate with your Docker socket to monitor disk usage and container health in real-time, giving you proactive warnings before a full disk triggers downtime.

FAQ

  • Question 1: Is it safe to run `docker system prune -a` when my server runs out of space?
    Answer 1: Running a blanket prune command is risky for any self-hosted infrastructure. While it reclaims space by removing unused containers and images, it can accidentally wipe out stopped utility containers or base images you rely on for rollbacks. Always inspect your storage categories first and perform targeted cleanups.
  • Question 2: How can I prevent Docker logs from filling up my disk in the future?
    Answer 2: You can permanently prevent log bloat by defining global logging drivers in your Docker daemon configuration (/etc/docker/daemon.json) or by specifying max-size and max-file parameters directly inside your Docker Compose files for each individual service.
  • Question 3: What should I do if my Docker volumes are taking up all my storage?
    Answer 3: Docker volumes often contain critical databases and persistent user files. Before deleting any volume labeled as “unused,” use inspection tools to verify whether it belongs to a decommissioned application whose data you might still need. Migrate persistent data to a dedicated backup location before purging.

Keep building your home lab infrastructure safely! If the relationship between containers and images still feels fuzzy, start with the site’s Docker containerization guide.



Read the original article

0 Like this
data deleting Disk Docker Fix full
Share. Facebook LinkedIn Email Bluesky Reddit WhatsApp Threads Copy Link Twitter
Previous Article20 Classic and Retro-Themed Games You Can Play on Linux
Next Article Sort Files by Date and Time Using ls command in Linux

Related Posts

Check your ISP router now: UPnP may be opening ports for devices you never approved
Selfhosting

Check your ISP router now: UPnP may be opening ports for devices you never approved

November 30, 2026
This New Free Tool Wants to Manage Your Entire Home Lab
Selfhosting

This New Free Tool Wants to Manage Your Entire Home Lab

November 27, 2026
I put my TV and consoles on their own network, and my video calls stopped freezing
Selfhosting

I put my TV and consoles on their own network, and my video calls stopped freezing

November 16, 2026
Add A Comment
Leave A Reply Cancel Reply

Top Posts
8 Linux Handheld Computers You Can Splurge On

8 Linux Handheld Computers You Can Splurge On

July 18, 202660 Views
WireGuard on Synology NAS: Secure Remote Access

WireGuard on Synology NAS: Secure Remote Access

May 15, 202542 Views
7 Best Command-Line Text Editors for Linux

7 Best Command-Line Text Editors for Linux

November 8, 202632 Views
Stay In Touch
  • Facebook
  • Mastodon
  • Bluesky
  • Reddit

Subscribe to Updates

Get the latest creative news from ioupdate about Tech trends, Gaming and Gadgets.

About Us

Welcome to IOupdate — your trusted source for the latest in IT news and self-hosting insights. At IOupdate, we are a dedicated team of technology enthusiasts committed to delivering timely and relevant information in the ever-evolving world of information technology. Our passion lies in exploring the realms of self-hosting, open-source solutions, and the broader IT landscape.

Most Popular
8 Linux Handheld Computers You Can Splurge On

8 Linux Handheld Computers You Can Splurge On

July 18, 202660 Views
WireGuard on Synology NAS: Secure Remote Access

WireGuard on Synology NAS: Secure Remote Access

May 15, 202542 Views

Subscribe to Updates

Facebook Mastodon Bluesky Reddit
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms and Conditions
© 2026 ioupdate. All Right Reserved.

Type above and press Enter to search. Press Esc to cancel.