How to Fix Disk Quota Exceeded on cPanel Hosting
In this article9 sections
“Disk quota exceeded” is one of the most disruptive errors on shared hosting. Uploads fail, the database stops accepting writes, email bounces, and sometimes the site returns errors that look like something else. The quota is the storage your plan allows, and the usual cause is not the website at all: old backups, mail that was never cleaned up, log files that keep growing, or a cache that was never cleared. This guide shows how to find what is using the space, how to clear it safely, and how to stop it coming back.
SiteHarbour’s cPanel plans list their storage limit on each plan page. If the account is close to that limit, the steps below show where the space went, and when it is time to move to a larger plan.
Step 1: See how much space you use
In cPanel, open Disk Usage. It shows the total used and a breakdown by folder. The largest folders are the first place to look. Do not start deleting from memory. Let the numbers tell you where the space went.
Expected: a list of folders with sizes. Often one or two folders account for most of the usage, such as mail, a backup folder or a log folder.
Step 2: Find the largest folders over SSH
The disk usage page is accurate but shallow. Over SSH you can find the largest items inside the home folder:
du -sh ~/* ~/.[!.]* 2>/dev/null | sort -h | tail -n 15
Expected: the 15 largest items, biggest last. Drill into any large folder with the same command, changing the path:
du -sh ~/public_html/* 2>/dev/null | sort -h | tail -n 15
Step 3: Check the usual suspects
Most quota problems come from one of these:
- Backups. Folders such as
~/backup, or archives left inpublic_html, often hold several copies of the site. Keep one recent copy off the server, and delete the rest once you have it. - Email. Mailboxes keep every message, including large attachments. Check Email Accounts for the quota of each mailbox, and archive old mail to a local folder before you clear it.
- Logs. The access and error logs in
~/logsgrow without limit. Rotate them, or truncate the one that is huge, after you have read it. - Caches. Plugin caches, image caches and the temporary files of an application can grow large and never shrink.
- Old installs. A previous WordPress or Laravel copy in a subfolder keeps its full code and uploads.
Step 4: Clear the space safely
Before you delete anything, copy it or confirm you have a backup. Then remove the largest item you no longer need. For a log that is too large to keep, shrink it without deleting the file, so the running service keeps writing to the same path:
: > ~/logs/example.com.access.log
Expected: the file size drops to zero, and the disk usage page updates after a few minutes. Keep the last few hundred lines first if you need them:
tail -n 1000 ~/logs/example.com.access.log > ~/logs/recent.log && : > ~/logs/example.com.access.log
Step 5: Empty the trash and the mail queue
The mail trash in Email Accounts and the file trash in File Manager can hold space until they are emptied. Empty them after you check that nothing in them is needed. Then check the disk usage again: many people find the space is back once the trash is cleared.
Step 6: Stop it coming back
Quota problems return because nothing limits the growth. Set three habits:
- A monthly check. Look at disk usage once a month and record the number. A steady climb shows a leak before it becomes an outage.
- A log rotation. Ask your host or use a cron job to rotate the logs weekly.
- Off-server backups. Keep backups on another storage service, so they do not fill the account. The steps are in how to back up and restore a cPanel account.
When to move to a bigger plan
If the site keeps growing after the cleanup, the plan is too small, not the account. Estimate the growth from your monthly numbers: if the account adds 1 GB every three months and has 2 GB free, you have about six months. Moving to a larger plan is simpler than trimming a site that needs the space. Compare the options in shared hosting, cPanel or VPS: how to choose.
Common mistakes
- Deleting a backup you have not copied. The archive may be your only copy of a deleted file.
- Deleting a log the service is writing to. Truncate it instead, so the path stays valid.
- Clearing the mail queue before you know why it grew. A growing queue means mail is failing.
- Forgetting the trash. Space held in trash still counts against the quota.
Frequently asked questions
Why does the disk usage differ from the folder sizes?
Disk usage counts the trash, the mail and some hidden files that a folder listing may not show. Use the SSH command to see the hidden files too.
Can a database cause the quota error?
Yes. A table that keeps growing, such as a log or session table in a plugin, can fill the account. Check the size of each database in phpMyAdmin and clean up the table if it is a log.
Will the site go down when the quota is full?
Writes fail first: uploads, database updates and mail. Pages may still load, which makes the problem harder to notice.
Should I delete the mail archive?
Only after you have downloaded or archived the mail you need. Mail is often the largest and least checked part of the account.
Disk quota errors are solved by measurement, not guessing. Check Disk Usage, find the largest folders with du, clear what you can prove you no longer need, and keep one recent backup off the server. Then set a monthly check, so the account does not reach its limit again without warning.