Prerequisites
Before checking disk usage, make sure you have:
- SSH access to your VPS
- Your server IP address and password
⚠️ Low disk space (<10%) can cause server crashes and data corruption. Monitor disk usage regularly!
Method 1: Check Overall Disk Usage (df)
Connect to your VPS:
ssh hxroot@YOUR_SERVER_IP -p 22Basic disk usage:
df -hExample output:
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 75G 45G 26G 64% /
udev 3.9G 0 3.9G 0% /dev
tmpfs 798M 1.2M 797M 1% /runColumns explained:
- Size - Total partition size
- Used - Space used
- Avail - Free space available
- Use% - Percentage used
- Mounted on - Mount point (usually / is root)
Include inode usage (important for file counts):
df -iMethod 2: Check Directory Size (du)
Check size of current directory:
du -shCheck size of specific directory:
du -sh /varSee sizes of all subdirectories:
du -h --max-depth=1 /varSort directories by size (largest first):
du -sh /* | sort -rh | head -10Method 3: Find Largest Files on Server
Find top 10 largest files (can take time):
find / -type f -exec du -h {} + 2>/dev/null | sort -rh | head -10Faster alternative:
find / -type f -size +100M -exec ls -lh {} ; 2>/dev/nullMethod 4: Check Disk Usage via Hostxpeed Portal
You can also monitor disk usage in your Hostxpeed client area:
- Log in to Hostxpeed Client Area at https://server.softileo.com
- Go to My Services
- Click on your VPS service
- Look for the Storage Used card showing percentage and GB used/total
Check Specific Common Directories
Check /var (logs, databases, caches):
du -sh /varCheck /home (user files):
du -sh /homeCheck /root (root home):
du -sh /rootCheck web directory:
du -sh /var/wwwMonitor Disk Usage in Real Time
watch -n 5 df -hUpdates every 5 seconds. Press Ctrl+C to exit.
Find Large Log Files
du -h /var/log | sort -rh | head -10Check Disk Usage with ncdu (Interactive Tool)
Install ncdu:
apt install ncdu -yRun ncdu:
ncdu /Navigation within ncdu:
- Arrow keys to navigate
- Enter to go into directory
- d to delete file/directory
- q to quit
Set Up Disk Usage Alert
Create a monitoring script:
#!/bin/bash
THRESHOLD=85
USAGE=$(df -h / | awk 'NR==2 {print $5}' | sed 's/%//')
if [ $USAGE -gt $THRESHOLD ]; then
echo "Warning: Disk usage is at ${USAGE}% on $(hostname)" | mail -s "Disk Alert" admin@example.com
fiAdd to cron to run daily:
0 9 * * * /root/check-disk.shCommon Disk Cleanup Commands
Clean apt cache (Ubuntu/Debian):
apt cleanapt autoremoveClean old logs:
journalctl --vacuum-time=7dClean temporary files:
rm -rf /tmp/*Find and delete old backup files:
find /home -name "*.bak" -type f -mtime +30 -deleteEmpty trash for all users:
rm -rf /home/*/.local/share/Trash/*✅ You can now monitor disk usage on your Hostxpeed VPS and identify what is consuming space.