How to check disk usage on a Linux VPS

Print
  • 0

Disk usage issues can stop updates, backups, logs, databases, and game saves from writing correctly. Check both total disk usage and which folders are taking the most space.

  1. Connect to the VPS with SSH.
  2. Show mounted disk usage:
    df -h

    Ubuntu VPS terminal showing df -h disk usage output

  3. Check the largest folders in the current directory:
    du -h --max-depth=1 | sort -h

    Ubuntu VPS terminal showing du folder usage output sorted by size

  4. Check common large locations such as /var/log, /home, /tmp, and /var/lib/docker.

Do not delete files unless you know what they are. If the VPS is low on space and you are not sure what is safe to remove, submit a support ticket with the output of df -h.

 

Useful cleanup checks

CommandUse
sudo du -h --max-depth=1 /var | sort -hFind large folders under /var.
sudo journalctl --disk-usageCheck how much space systemd logs use.
docker system dfCheck Docker disk usage if Docker is installed.
find / -type f -size +1GFind very large files. Run carefully because it scans the disk.

Take care with automated cleanup commands. Removing the wrong folder can delete game worlds, databases, or uploaded files.


Was this answer helpful?

Related Articles

« Back

Follow us on Social Media

Stay in the loop! Follow our social media accounts and stay up-to-date with the latest news, announcements, tips & tricks and behind-the-scenes insights!