Short answer: run df -h to confirm the disk is full, then du -xh --max-depth=1 / | sort -h to find the folder that grew. On a VPS it is almost always logs, Docker images and container logs, package caches, old backups or uploads. Free space with journalctl --vacuum-size=200M, apt clean and docker image prune, put a size limit on each so it doesn't come back, and only then think about a bigger disk.
A full disk breaks things in odd ways: databases stop, a web panel shows errors, SSH logins hang, programs crash with No space left on device. The fix usually takes a few minutes once you know where to look. Everything below works on Ubuntu and Debian as root (or with sudo).
01How Big Is the Disk on Each Plan?
| Linux plan | Disk | Price |
|---|---|---|
| 1 vCPU, 1 GB RAM | 10 GB NVMe | $3.90 a month |
| 1 or 2 vCPU, 2 GB RAM | 20 GB NVMe | $6.50 a month |
| 4 vCPU, 6 GB RAM | 40 GB NVMe | $13.00 a month |
| 6 vCPU, 10 GB RAM | 40 GB NVMe | $26.00 a month |
| 6 vCPU, 10 GB RAM | 80 GB NVMe | $39.00 a month |
| Storage VPS | 1, 2 or 4 TB HDD plus an NVMe system disk | from $32.50 a month |
The system itself takes a few GB, so on the 10 GB plan a couple of Docker images or a week of verbose logs is enough to fill it.
02Step 1: Is the Disk Really Full?
df -h /
df -i /df -hshows space.Use%at 100% (or 95% and above) is your problem.df -ishows inodes, the number of files the disk can hold. IfIUse%is at 100% while space is free, you have too many small files: jump to step 5 below.
03Step 2: Which Folder Filled It?
Start at the top and follow the biggest folder down:
du -xh --max-depth=1 / 2>/dev/null | sort -h | tail -n 12
du -xh --max-depth=1 /var 2>/dev/null | sort -h | tail -n 12-x stays on this disk, so /proc and mounted volumes don't confuse the numbers. Repeat with the biggest folder each time (/var/log, /var/lib/docker, /home/...) until you find the culprit.
To list single large files anywhere on the disk:
find / -xdev -type f -size +500M -exec ls -lh {} \; 2>/dev/null04Step 3: What Is Safe to Delete?
The usual suspects, with the command that shows the size and the one that frees it:
| What | Check | Free it |
|---|---|---|
systemd journal (/var/log/journal) | journalctl --disk-usage | journalctl --vacuum-size=200M |
Old rotated logs (/var/log/*.gz, *.1) | ls -lhS /var/log | find /var/log -type f -name "*.gz" -delete |
| One huge live log file | ls -lh /var/log/app.log | truncate -s 0 /var/log/app.log (not rm, see step 5) |
| apt package cache | du -sh /var/cache/apt | apt clean |
| Old kernels and unused packages | apt autoremove --dry-run | apt autoremove --purge |
| Docker images, stopped containers, build cache | docker system df | docker image prune -a, docker container prune, docker builder prune |
| Docker container logs | du -sh /var/lib/docker/containers | log limit below, then recreate the container |
| Old snap revisions (Ubuntu) | snap list --all | snap set system refresh.retain=2 |
| Your own backups, dumps, uploads | du -sh /home/* /root /var/backups | Move them off the server, then delete |
If you use a hosting panel, its own local backups and logs are often the biggest folder. Check the panel's backup settings and keep fewer copies on the server itself.
05Step 4: Restart What Broke
Once there is space again, restart the services that failed while the disk was full, then check they're running:
systemctl --failed
systemctl restart mysql # or nginx, postgresql, docker, your app
df -h /If a database refused to start, read its log first (journalctl -u mysql -n 50), since a crash on a full disk can need a moment of recovery on the next start.
06Step 5: Space Is Free, but the Error Stays
Two cases explain almost every "df shows free space but I still get No space left on device":
A deleted file is still open. If you rm a log that a program is still writing to, the space is only released when that program closes it. Find such files and restart the program that holds them:
lsof +L1 2>/dev/null | head -n 20Inodes are used up. Millions of tiny files (session files, cache folders, a mail queue, a runaway script writing one file per event) fill the inode table long before the space. Find the folder with the most files:
du --inodes -x / 2>/dev/null | sort -n | tail -n 12Then delete what that folder doesn't need, or fix the program that keeps creating them.
07Step 6: How Do You Stop It from Filling Up Again?
Cleaning up fixes today. Limits fix next month.
Cap the journal
In /etc/systemd/journald.conf set SystemMaxUse=200M, then systemctl restart systemd-journald.
Cap Docker logs
Put the block below in /etc/docker/daemon.json and systemctl restart docker. It applies to containers created after the change.
Rotate your own logs
Write app logs to /var/log/yourapp/ and add a logrotate rule, or log to the journal and let the cap above handle it.
Clean on a timer
crontab -e, then 0 4 * * 0 docker image prune -af removes unused images every Sunday at 04:00.
Get warned in time
A cron job that checks df and messages you before 90% is cheaper than an outage.
{
"log-driver": "json-file",
"log-opts": { "max-size": "10m", "max-file": "3" }
}A minimal warning script, here posting to a Telegram bot of your own (put your bot token and chat id in):
#!/bin/bash
USE=$(df --output=pcent / | tail -1 | tr -dc '0-9')
if [ "$USE" -ge 90 ]; then
curl -s "https://api.telegram.org/botYOUR_TOKEN/sendMessage" \
-d chat_id=YOUR_CHAT_ID -d text="Disk at ${USE}% on $(hostname)"
fiRun it hourly from cron: 0 * * * * /root/disk-alert.sh. Building the bot itself takes a few minutes: see How to Host a Telegram Bot 24/7.
08When Do You Need a Bigger Disk?
When du shows the space is real data you want to keep: a growing database, media uploads, a blockchain. A running server can't be resized in place, so order the larger plan, copy the data over and let the old server run out at the end of its paid period. Both run side by side while you move, so there's no downtime. For terabytes of data, the Storage VPS has a 1 to 4 TB disk; a Bitcoin node is the classic case (Run a Bitcoin Node on a VPS).
09And on a Windows Server?
On Windows RDP the same causes apply in Windows form: downloads, logs, the update cache. Run Disk Cleanup (cleanmgr) and choose "Clean up system files", empty the Recycle Bin, and clear the component store with Dism.exe /online /Cleanup-Image /StartComponentCleanup in an administrator PowerShell.
The disk has no free space or no free inodes left. Check both with df -h and df -i.
Run du -xh --max-depth=1 / | sort -h, then repeat inside the biggest folder until you find the files that grew. ncdu -x / does the same interactively.
Old rotated logs (.gz, .1) yes. For the journal use journalctl --vacuum-size, and for a log a program is still writing to use truncate -s 0 instead of rm.
A program still has a deleted file open. lsof +L1 lists them; restart that program to release the space.
docker system df shows what uses it. docker image prune -a and docker builder prune are safe for data; avoid --volumes unless you know no container keeps data there.
Not in place. Order a plan with a larger disk, move your data over, and let the old server run out at the end of its paid period.
- vps disk full
- no space left on device
- linux disk full
- free disk space linux
- docker disk space
- journalctl vacuum