Why VPS disk full happens and how to resolve it

Quick Answer

A VPS disk full error occurs when your virtual server’s storage reaches 100% capacity, preventing new file writes, database operations, and application functionality. In 2026, this remains a common issue for WordPress sites, development environments, and production servers. The solution involves identifying large files or processes consuming space, removing unnecessary data, and implementing automated monitoring to prevent recurrence.

Why This Matters

Disk space exhaustion is one of the top three causes of unplanned server downtime, according to a 2025 Uptime Institute report. When your VPS runs out of disk space, your website typically goes offline, databases fail to write, backups cannot complete, and users experience complete service disruption. For businesses running WordPress, e-commerce platforms, or APIs on VPS infrastructure, a full disk can result in lost revenue, damaged reputation, and hours of emergency troubleshooting. Proactive monitoring and space management are therefore not optional—they’re critical to availability.

What Causes VPS Disk Full Errors?

VPS disk capacity is finite. Unlike cloud-native systems that auto-scale, a VPS has a fixed allocation—typically 20 GB to 500 GB depending on your plan. Several factors cause this space to fill:

  • Log file accumulation: Application logs, web server logs, system logs, and database logs grow continuously. An unconfigured WordPress installation or a noisy application can generate gigabytes of logs monthly.
  • Database bloat: WordPress databases store posts, comments, metadata, revisions, and transients. Without regular optimization, a mature site’s database can consume 5–50 GB.
  • Backup files: Local backups, database dumps, and plugin backups stored on the server itself consume significant space. Many users keep multiple full backups without cleanup.
  • Temporary files: /tmp directories, cache files, session data, and incomplete uploads accumulate if cleanup routines fail.
  • Unused applications and dependencies: Abandoned Docker images, package manager caches, and old application installations silently occupy space.
  • Media library growth: WordPress media files, CDN-unoptimized images, and video storage can easily consume 10–100+ GB on content-heavy sites.

How Do You Diagnose a Full VPS Disk?

Before resolving the issue, identify what’s consuming space. SSH into your VPS and run these commands:

# Check overall disk usage
df -h

# Identify large directories
du -sh /* | sort -hr

# Find the largest files
find / -type f -size +100M -exec ls -lh {} \; | sort -k5 -hr | head -20

# Check WordPress-specific space hogs
du -sh /var/www/html/wp-content/uploads
du -sh /var/www/html/wp-content/cache
du -sh /var/www/html/wp-content/plugins

The df -h command shows your partition usage at a glance. If you see 95% or higher, action is needed immediately. The du -sh commands pinpoint which directories consume the most space, allowing you to make informed decisions about what to delete or archive.

What Are the Best Practices for Removing Unnecessary Files?

Once you’ve identified the culprits, remove files strategically:

  • Compress and archive old logs: Move log files older than 30 days to compressed archives or delete them. Most applications only need current logs for debugging. Use logrotate to automate this on Linux.
  • Optimize and export the database: Use mysqlcheck or WordPress database optimization plugins to remove orphaned data, revisions, and expired transients. Alternatively, export the database to an external drive or cloud storage and reimport a cleaned version.
  • Clean the WordPress media library: Use plugins like Filebird or WP Smush to delete unused, orphaned, or duplicate media files. Manually audit your uploads folder for files no longer linked to posts.
  • Remove old backups from disk: Keep only the latest 1–2 local backups; store older backups on S3, Backblaze, or another offsite service. Delete backups older than 30 days from the VPS itself.
  • Clear temporary and cache directories: Remove files from /tmp, /var/tmp, and application-specific cache directories. Many frameworks cache data indefinitely without cleanup.
  • Uninstall unused Docker images and containers: If you’re running Docker, run docker system prune -a to remove unused images, containers, and volumes. Verify no production services depend on them first.

Which Monitoring and Prevention Strategies Work Best?

Preventing a full disk is far easier than recovering from one. Implement these practices:

  • Set up disk usage alerts: Tools like Datadog, New Relic, and open-source alternatives (Prometheus + Grafana) monitor disk usage in real-time. Configure alerts to notify you when usage exceeds 75% and 90%.
  • Enable log rotation: Configure logrotate on Linux to automatically compress and delete old logs. A typical /etc/logrotate.d/ config rotates logs weekly or when they reach a size threshold.
  • Schedule automated WordPress maintenance: Use plugins like WP-Optimize or Advanced Database Cleaner to vacuum your database weekly, removing revisions, trashed posts, and expired transients.
  • Implement offsite backups: Use services like Backblaze, AWS S3, or Cloudflare R2 for automated backups. These eliminate the need to store full backups locally.
  • Use CDN for static assets: Cloudflare, BunnyCDN, or similar CDN providers serve images and media from edge locations, reducing your origin disk footprint.
  • Review VPS plan sizing: If you regularly approach capacity, upgrade to a larger disk allocation or consider cloud-native architecture with autoscaling.

Related Guides on abdulabror.com

FAQ

Q: Can I expand my VPS disk without migrating?

Yes, most VPS providers allow you to increase disk allocation within the control panel (cPanel, Plesk, or provider dashboard). However, this depends on your hosting infrastructure. Some providers support online resizing of the root partition; others require you to resize the underlying virtual volume and then extend the filesystem using lvextend and resize2fs. Check with your VPS provider’s documentation or contact support before attempting this.

Q: What’s the difference between disk space and inodes?

Disk space measures bytes; inodes measure the number of files. A VPS can run out of inodes (maximum files) before running out of bytes, particularly if you have millions of small files or many temporary files. Check inode usage with df -i. If inodes are exhausted, delete small files or temporary directories, even if byte usage seems low.

Q: Should I delete database backups from my VPS?

Yes, if they’re local backups older than your retention policy. Always keep at least one recent backup on disk for emergency restore scenarios, but move daily/weekly archives to offsite storage (S3, Google Cloud Storage, or Backblaze). This frees VPS space while maintaining security and compliance.

Q: How often should I check disk usage?

With automated monitoring in place, check proactively weekly or monthly. However, if you notice warning alerts or if your site serves user-generated content (comments, uploads), review space usage every 2–4 weeks. During active business periods or after marketing campaigns, check more frequently.

Q: Can a full disk cause permanent data loss?

A full disk does not inherently delete data, but it prevents writes. This can corrupt database transactions, incomplete backups, and temporary files. The bigger risk is that the service becomes unavailable for hours, causing lost transactions or downtime. Restore from a recent backup if critical data is affected. Always maintain offsite backups as insurance.

References



Leave A Comment

Need help with WordPress or hosting?

Based in Bali, Indonesia

Providing technical hosting support and WordPress services to clients worldwide. Remote-friendly, reliable, and always focused on practical solutions.

Samping work with me