how to monitor VPS disk space before it fills up | 2026

Learn how to monitor VPS disk space before it fills up. Track disk usage, set alerts, and prevent crashes. Read the guide!

Futuristic server rack with glowing LEDs and holographic rings tracking VPS storage capacity.

A full disk can crash your website, stop your apps, and even corrupt your data. Learning how to monitor VPS disk space before it fills up is one of the most important skills for anyone running a server. Think of your VPS disk like the storage on your phone. When it gets full, you cannot take photos or install new apps. A VPS works the same way. When the disk is full, your server stops working properly.

This guide will show you how to monitor VPS disk space in five clear steps. You will learn to check usage, find big files, set up alerts, automate checks, and plan for the future. No deep Linux knowledge is needed. If you can type commands into a terminal, you can follow this guide.

Quick Overview — Key Steps to Monitor VPS Disk Space Proactively

Before we dive into the details, here is a fast look at what you will learn. This section gives you the big picture so you know what to expect when you monitor VPS disk space the right way.

The 5-Step Monitoring Framework

To monitor VPS disk space well, follow these five steps in order:

  1. Establish a baseline of your current disk usage.
  2. Find what is eating your disk space.
  3. Set smart thresholds and alerts.
  4. Automate the monitoring process.
  5. Forecast growth and plan ahead.

Each step builds on the last one. Skip none of them if you want reliable results.

Essential Commands Cheat Sheet

Here are the core commands you will use to monitor VPS disk space:

Command What It Does
df -hT Shows disk space for all mounted drives in human-readable form
df -i Shows inode usage (number of files)
du -sh /path Shows total size of a folder
find / -size +500M Finds files larger than 500MB
lsof +L1 Finds deleted files still held open by programs

Recommended Tools at a Glance

Beyond basic commands, these free tools help you monitor VPS disk space with less effort:

  • Netdata — A free web dashboard with real-time charts and alerts.
  • Prometheus + Grafana — A powerful pair for metrics and visual dashboards.
  • Monit — A lightweight tool that watches your disk and sends alerts.
  • ncdu — An interactive tool to browse disk usage by folder.
  • duf — A colorful, easy-to-read version of the df command.

Step 1 — Establish a Baseline of Your VPS Disk Usage

Before you can monitor VPS disk space well, you need to know what “normal” looks like. A baseline is a snapshot of your disk usage at a given time. It helps you spot changes later.

Check All Mounted Filesystems with df -hT

The df command is your starting point. Type this in your terminal:

df -hT

The -h flag makes the output easy to read (it shows sizes in GB or MB). The -T flag shows the file system type (like ext4 or xfs). Look at the Use% column. If any line shows 80% or more, that mount point needs attention.

Pay close attention to the Mounted on column. This tells you which folder path each disk is linked to. The root path (/) is your main system disk. Other paths like /home or /var might be on separate disks.

Monitor Inode Usage with df -i (Often Overlooked)

Many people forget about inodes when they monitor VPS disk space. Inodes are like index cards for files. Each file on your disk uses one inode. If you run out of inodes, you cannot create new files, even if you have free gigabytes.

To check inode usage, type:

df -i

Look at the IUse% column. If it is above 80%, you have too many small files. This often happens with old session files, cache files, or emails stuck in a queue.

Identify Mount Points That Fill Independently

Some VPS setups split the disk into separate parts. For example, /var (where logs live) might be on its own partition. If /var fills up, the rest of the system still works, but your logs stop and services may crash.

Make a list of all your mount points from the df -hT output. Track each one separately when you monitor VPS disk space over time.

Step 2 — Find What Is Consuming Disk Space on Your VPS

Once you know which disk is full, the next step is to find out why. This is where you play detective to monitor VPS disk space issues at the file level.

Use du to Locate the Largest Directories

The du command shows how much space each folder uses. To see the top-level folders on your root disk, type:

sudo du -xhd1 / | sort -hr | head -20

Let us break this down. The -x flag keeps the search on one disk. The -h flag shows sizes in GB or MB. The -d1 flag means only look one level deep. The sort -hr part puts the biggest folders first. The head -20 part shows only the top 20 results.

Start with the biggest folder and drill down. For example, if /var is the largest, type:

sudo du -xhd1 /var | sort -hr | head -10

Hunt for Oversized Files with find

Sometimes a single huge file is the problem. To find all files over 500MB, type:

sudo find / -xdev -type f -size +500M -ls 2>/dev/null

This command searches your main disk for files bigger than 500MB. It shows the file path, size, and owner. You can change 500M to 1G or 100M depending on your needs.

Check Common Culprits: Logs, Caches, Docker Data, and Backups

Most disk space problems come from a few usual suspects. When you monitor VPS disk space, always check these folders first:

  • /var/log — System and application logs. Type: sudo du -sh /var/log/*
  • /var/lib/docker — Docker images, containers, and volumes.
  • /var/cache — Package and app caches.
  • /home or /backup — Local backups that were never moved off-server.
  • /tmp and /var/tmp — Temporary files that should auto-delete but sometimes do not.

For logs, check the systemd journal too:

journalctl –disk-usage

Detect Deleted-but-Open Files with lsof

Here is a tricky problem. Sometimes you delete a big log file, but the disk space does not come back. This happens when a program still has the file open. The file is “deleted” but still takes up space.

To find these ghost files, type:

sudo lsof +L1

This shows files that have been deleted but are still open. To free the space, restart the program that holds the file. For example, if it is a web server, type: sudo systemctl restart nginx.

Step 3 — Set Smart Disk Space Thresholds and Alerts

Checking disk space by hand is fine for a start, but you need alerts to truly monitor VPS disk space before it fills up. Alerts tell you when action is needed, even while you sleep.

Why Percentage-Only Alerts Are Not Enough

Most guides say “alert at 90% usage.” But this is not always smart. A 10GB disk at 90% has only 1GB free. A 1TB disk at 90% still has 100GB free. The same percentage means very different things on different disk sizes.

When you monitor VPS disk space, always think about both the percentage and the actual free space in GB.

Combine Percentage, Absolute Free Space, and Time-to-Full

The best alert system uses three checks together:

  • Percentage check — Alert if usage is above 85%.
  • Absolute free space check — Alert if free space is below 5GB (or a value that fits your VPS).
  • Time-to-full check — Alert if the disk will be full in less than 7 days based on current growth rate.

This mix catches problems early, no matter how big or small your disk is.

Configure Warning vs. Critical Alert Levels

Use two levels of alerts when you monitor VPS disk space:

Level Trigger Action
Warning Usage above 80% or free space below 10GB Check and plan cleanup
Critical Usage above 90% or free space below 3GB Immediate cleanup or add disk space

Warning alerts give you time to act. Critical alerts mean you must act now.

Avoid Alert Fatigue with Deduplication and Hysteresis

If your disk bounces between 79% and 81%, you do not want an alert every hour. This is called alert fatigue. To avoid it:

  • Deduplication — Only send one alert per problem per day.
  • Hysteresis — Set the warning trigger at 80%, but do not clear it until usage drops below 75%. This stops flip-flopping.

Step 4 — Automate VPS Disk Space Monitoring

Manual checks are easy to forget. To monitor VPS disk space reliably, you need to automate the process. Automation runs your checks on a schedule and sends you alerts without any effort on your part.

Build a Bash Monitoring Script with Email Alerts

Here is a simple script to monitor VPS disk space and send an email if usage is high. Create a file called disk-check.sh:

#!/bin/bash
THRESHOLD=85
EMAIL=”you@example.com”
df -hT | awk ‘NR>1 {gsub(/%/,””,$6); if ($6 >= THRESHOLD) print “Warning: ” $7 ” is ” $6 “% full”}’ | mail -s “Disk Alert” $EMAIL

This script checks all disks. If any is above 85% full, it sends an email. Make it executable with: chmod +x disk-check.sh

Schedule Checks with Cron or systemd Timers

To run the script every hour, add a cron job. Type:

crontab -e

Then add this line:

0 * * * * /path/to/disk-check.sh

This runs the script at the start of every hour. You can change the schedule to fit your needs.

Monitor Per-Mount-Point Disk Space Separately

If your VPS has multiple mount points, check each one on its own. This way, you know exactly which disk is in trouble. Update your script to loop through each mount point and report them one by one.

Use Netdata or Prometheus for Visual Dashboards

For a visual way to monitor VPS disk space, install Netdata. It takes just one command to set up:

bash <(curl -Ss https://get.netdata.cloud/kickstart.sh)

Netdata gives you a web dashboard at http://your-vps-ip:19999. You can see disk usage, growth trends, and set alerts — all in a nice chart. Prometheus with Grafana is a stronger option for bigger setups, but it takes more work to install.

Step 5 — Forecast Disk Growth and Plan Capacity Ahead

The best way to monitor VPS disk space is to stop problems before they start. Forecasting helps you see the future and plan ahead.

Calculate Daily Growth Rate from Historical Data

To guess how fast your disk fills, record usage over time. Save the output of df -h to a log file each day. After a week or two, you can calculate the average daily growth.

For example, if your disk used 50GB on Monday and 52GB on Friday, the growth is 2GB over 4 days, or 0.5GB per day.

Estimate Days Until Full for Each Mount Point

Once you know the daily growth rate, you can estimate when the disk will be full. Use this simple math:

Days until full = Free space (GB) ÷ Daily growth rate (GB/day)

If you have 20GB free and grow 0.5GB per day, you have 40 days left. This gives you plenty of time to act.

Account for Seasonal Spikes and Backup Cycles

Disk growth is not always steady. Backups, log rotations, and traffic spikes can cause sudden jumps. When you monitor VPS disk space, look at your data over at least one full month to see these patterns.

For example, if you take weekly backups, you might see a spike every Sunday. Plan your alerts around these known events.

When to Upgrade Storage vs. Optimize Usage

Sometimes the best answer is to clean up. Other times, you just need more disk. Here is a simple rule:

  • If cleanup gives you back more than 30% of the disk, optimize first.
  • If the disk is still over 70% full after cleanup, plan to upgrade.
  • If growth is steady and fast, upgrade before you run out of time.

Bonus — Monitor Disk Space for Docker and Container Workloads

If you run Docker on your VPS, containers can eat disk space fast. Here is how to monitor VPS disk space in a Docker setup.

Check Docker Disk Usage with docker system df

Type this command to see how much space Docker uses:

docker system df

This shows the size of images, containers, and volumes. Add the -v flag for a detailed view:

docker system df -v

Clean Up Images, Volumes, and Build Cache Safely

To free space, use Docker’s built-in cleanup command:

docker system prune

This removes unused images, stopped containers, and build cache. It will ask you to confirm before deleting anything. For a deeper clean, add the –volumes flag, but be careful — this deletes all unused volumes, including data.

Set Per-Container Storage Limits

To stop one container from filling the whole disk, set a storage limit when you create it. Use the –storage-opt flag with the docker run command. Check the Docker docs for your storage driver (like overlay2) to see the exact syntax.

FAQ — Common Questions About Monitoring VPS Disk Space Before It Fills Up

Q: How often should I monitor VPS disk space?

A: At least once a day. If your disk fills fast, check every hour or set up automated alerts.

Q: What is a safe disk usage level?

A: Keep usage below 80%. Above that, you risk slowdowns and crashes.

Q: Why does df show high usage but I cannot find big files?

A: Check for deleted-but-open files with lsof +L1. Also check inode usage with df -i.

Q: Can I monitor VPS disk space from outside the server?

A: Yes. Tools like UptimeRobot, Datadog, or a remote Prometheus setup can check your disk from outside.

Q: What if my VPS provider does not let me add more disk?

A: Focus on cleanup and optimization. Move logs and backups to external storage like S3. Consider moving to a bigger VPS plan.

Q: Is Netdata safe to install on a small VPS?

A: Yes. Netdata uses very little resources (about 100MB of RAM). It works well even on 1GB VPS plans.

Conclusion and Final Recommendations

Learning how to monitor VPS disk space before it fills up is a key skill for any server owner. By following these five steps, you can catch problems early and keep your server running smoothly.

Here are the key takeaways:

  1. Always start with a baseline. Know what normal looks like.
  2. Use df, du, find, and lsof to find what is using your disk.
  3. Set alerts that combine percentage, free space, and time-to-full.
  4. Automate checks with cron and tools like Netdata.
  5. Forecast growth to plan upgrades before you run out of space.

Start today. Run df -hT on your VPS right now. Set up one automated check. Small steps now will save you from big problems later. A server that you can monitor VPS disk space on with confidence is a server that stays up and keeps your users happy.