Skip to main content
To check disk space on Linux, run df -h: it lists each file system with its size, used and available space and use percentage. To see what is using the space, run sudo du -h --max-depth=1 / | sort -h, which lists the size of each top-level folder, then repeat inside the largest one. du -sh /var/log shows the total size of a single folder.

Before you start

  • Connect with SSH. df works for any user. du needs sudo (root can leave it out) to read folders you don’t own.
  • df (disk free) reports per file system. du (disk usage) adds up file sizes inside folders.

How to check free disk space with df

Example output:
Useful variations:
tmpfs and devtmpfs live in RAM, not on your disk. Your main disk is usually the line mounted on /.

How to find which folders use the most space with du

1

Size of each top-level folder

-x stays on one file system, so it skips /proc and other disks. sort -h puts the largest at the bottom.
2

Go one level deeper

Repeat on the largest folder until you find the cause, for example /var/log or /var/lib/docker.
3

Total size of one folder

How to list the largest files

This lists every file over 500 MB on the main file system.

How to browse disk usage with ncdu

ncdu is an interactive du: it scans once, then you browse with the arrow keys.
Press Enter to open a folder, d to delete the selected item (it asks first) and q to quit.

What if df says the disk is full but du doesn’t add up?

For a step-by-step clean-up, see fix “No space left on device” and find what is using disk space.
Don’t delete files in /usr, /lib, /boot, /var/lib/dpkg or /var/lib/rpm to free space; that breaks the system. Safe places to start are old logs (sudo journalctl --vacuum-size=500M), the package cache (sudo apt clean or sudo dnf clean all) and your own old backups. Take a snapshot before a large clean-up.

How to check it worked

After a clean-up, run df -h / again and compare the Avail column. If space doesn’t come back after deleting a large file, a program still has it open: restart that program or check sudo lsof +L1.

Frequently asked questions

Why is my disk smaller than my plan says?

df -h shows sizes in GiB (powers of 1024), while disk sizes are often sold in GB (powers of 1000), and the file system reserves some space for itself. If the partition is much smaller than the disk, it may need resizing after an upgrade; see resize a partition after a disk upgrade.

What does the “5% reserved” on ext4 mean?

ext4 keeps about 5% of blocks for root by default, so the system can still work when a normal user fills the disk. That space shows as used in df.

How do I see disk usage in the VPS Panel?

The panel shows your disk size; see view and manage VPS storage. For what is using space inside the server, use df and du.

How do I check the size of a single file?

Use ls -lh file.tar.gz or du -h file.tar.gz.

VPS and dedicated server guides

Every server guide in one place.

Fix No space left on device

When the disk is full.

Find what is using disk space

Track down large folders.

Clean up Docker disk space

Remove unused images and volumes.

VPS storage

Your disks in the VPS Panel.

Checked against the official GNU Coreutils manual for df and du on 4 November 2026; commands tested on Ubuntu 24.04 LTS. Commands can differ on other distributions or releases.

Need Extra Help?

If you encounter any issues, our support team is ready to assist:

Save on Your Hosting

Ready to upgrade your hosting? Use code KB20 at checkout for 20% off your first order!

Last Updated: November 2026