If you attempt to upload a file, update your database, or send an email from your control panel, you may receive an error message stating, "Disk quota exceeded." This message indicates that your account has exceeded its allocated disk space, and you must free up space to resolve the issue.
To resolve this problem, this guide will provide detailed instructions on how to increase your disk space in cPanel and VPS (WHM) and tips on avoiding this issue in the future.
How To Fix Disk Quota Exceeded from CPanel?
In the initial section, we will see on expanding the disk space in cPanel by addressing your web hosting files.
To identify which directories are taking up the most space, we will utilize the cPanel disk usage tool.
Log into cPanel account -> Go to Files section -> Click on Disk Usage option.
You can see that this tool provides a clear indication of which directories you should prioritize when accessing your file manager.
In the following image, located at the bottom of the same page, clicking on one of the directories will reveal additional directories. By continuing to navigate within the directory, you can determine which folder or file to delete from your file manager.
Step 2: Clean the trash folder
If you delete files and directories directly from the file manager, it is possible that those files may not be permanently removed and may still be located within the trash file.
To permanently delete the files, you need to check the trash folder by selecting File Manager and then navigating to the .trash folder to delete its contents.
If you cannot locate the trash folder, it may be due to your files being hidden. To reveal them, you must adjust the settings to enable their visibility.
Go to the upper right side of the screen -> Click on Settings -> Check the option Show Hidden Files.
Step 3: Delete Backups and Snapshots
Backups typically occupy the most disk space, often compressed into a zip file under the directory names of "backup" or "snapshots". If you encounter such a file, deleting as many backups as possible is recommended to free up disk space.
Note:
1. Ensure that you have at least one backup.
2. A confirmation popup will appear when deleting a folder or directory. Therefore, it is crucial to ensure that you select "Skip the trash and permanently delete the files" option to confirm permanent deletion.
Step 4: Clean your emails
If you use the IMAP protocol to store your emails in cPanel, freeing up additional disk space can be achieved by deleting spam emails, junk emails, drafts, and archives.
You may find a substantial accumulation of such emails that may have accumulated over several months or even years. Thus, it is an ideal opportunity to clean up your emails.
Additionally, you can also remove any email accounts that are no longer in use to free up additional disk space.
Note:
It is essential to note that even after resolving the "disk quota exceeded" issue, the control panel may not immediately reflect the difference in the disk space information. This may occur due to the Disk Quota Cache, which stores the disk usage information for approximately 15-30 minutes.
Step 5: Clear cache in cPanel
To clear your cache in cPanel, you should review the contents of the /tmp and /cache folders.
Important Note: If you have a third-party caching system installed on your cPanel, clearing the cache from its settings is recommended.
Step 6: Clean log files
The logs folder is also worth examining. The server records each event in your log files every hour or minute. Over several months and years, the logs folder's size can become substantial, so cleaning it if it occupies significant disk space is recommended.
Step 7: Remove unused web apps
It is common to have some installation files of your app or staging versions of your application somewhere. Ensuring that none of these files are left behind is crucial in such cases.
How to prevent this from happening again from WHM Panel?
If you are using a VPS server, you can follow these three steps:
Step 1: Modify the WHM quota for your account
Log into the WHM account -> Click on List Accounts -> Select the account you want to modify the disk quota -> Click on the Change Quota button.
Another way to do this:
If you change the email quota to unlimited, you are less likely to encounter any "mail quota exceeded" errors in the future. For that, you need to click the Modify Account button, go to the Resources Limit section and select Unlimited to the options below.
Step 2: Keep the backups to the minimum
Next, we will configure our backups to help optimize our disk space.
Navigate to Backup Configuration and ensure the backup type is set to Compressed.
After that, on the same page, scroll down to "Scheduling and Retention." Change your scheduled backups from Daily to Weekly, then set the retention number of backups to the absolute minimum number you feel comfortable with.
Step 3: Add a new backup destination for WHM backups
To save most of your cPanel disk usage, you can activate the cPanel backup to Google Drive, which is a great option. Then, you need to add Google Drive as a remote storage location for your WHM backups.
To do it, navigate to Backup Configuration -> Additional Destinations -> Destination Type -> Google Drive.
Conclusion:
It's important to note that if you were able to free up some disk space today but still don't have much space left, you should think about the future. As your WordPress site grows with added content, its size will naturally increase.
It's best to reach a critical point immediately; instead, consider moving to a more stable and long-lasting web hosting solution now to ensure your site's continued success.
That's all.