How to optimize hosting account space

In this article we will explain how to clean up your hosting account making some disk space for future needs. Cases when your website files take more than 2-4 GB are quite rare, so before planning the upgrade to the next tier because of the excessive disk space usage or transferring your account to another server, we recommend checking if all files in your account are actually necessary:

How do I check my disk space usage?

You can find the detailed disk usage stats of your cPanel account in Files section > Disk Space Usage menu:

For cPanel Basic Theme:

For cPanel Retro Theme:

Inside, you can check general statistics by folders or sort folders by their disk space usage:

 

NOTE: Hidden (dot) files and folders will not be shown in the list. In order to see all files and folders, you should navigate to File Manager menu in cPanel with the Show Hidden Files (dotfiles) option checked.

Unnecessary backups

It is always a good idea to keep backups of your websites or whole hosting account.

However, if your website has a lot of media files or a big database, backups may take a significant amount of the hosting account disk space. That is why old backups you need should be downloaded and stored on your local machine and uploaded back only if required.

Data of old websites

Removing a domain from the list of addons does not actually remove all files/databases associated with it, so if you have a lot of folders named by domains which are no longer active or hosted somewhere else, you should consider removing them.

Most CMSs like WordPress or Joomla have a database attached to the website, which needs to be removed separately in cPanel > MySQL Databases menu:

 

You can check what database is being used for the website in the configuration file, for example, wp-config.php for a WordPress website, configuration.php for Joomla, etc.

Big media files

We do not allow either hosting websites with heavy media content or file storage on our shared servers due to server performance reasons. This is why we have limitations for downloadable files, specifically – no more than 10Gb of a shared hosting account can be allocated to music, video or other multimedia files including but not limited to .avi, .mp3, .mpeg, .jpg, .gif files.

You may find more information about this and other limitations in our Acceptable Use Policy – section Disk Usage Provision.

If your website has a large amount of media content such as images or videos, we suggest storing them on file sharing servers designed specifically for this purpose.

Junk files

A long-lasting hosting account may also accumulate a big number of various junk files which are taking a lot of disk space. Known examples of such files are:

Core dump files ( e.g., core.xxxx files) – some hosting providers enable generation of core dumps which contain the recorded state of the working server memory at a specific time, generally, when the program/script has terminated abnormally (crashed). Debugging scripts with the help of such files may be difficult and not needed since general logs usually provide the exact reason of a script failure, so feel free to delete all of these files.

You may also run this cron job to find and delete all .core files in your account automatically:

rm -f $( find ${HOME} | grep /core.[0-9]*$ ) >/dev/null 2>&1

Non-delivery reports in the default cPanel email account – each cPanel account has a default email account (cpanel_username@server_name), all system emails related to your cPanel mail service will be going to this mailbox, e.g., non-delivery reports about emails sent by cPanel (including emails sent by some PHP scripts), cron job running reports, unrouted emails, etc.

Despite their small size a big number of such emails may also cause issues with the account disk space usage.

In order to delete all emails/files in the default email accounts, feel free to use these cron jobs:

cd /home/cPanel_username/mail/new/; rm -fv *
cd /home/cPanel_username/mail/cur/; rm -fv *

Make sure you update cPanel_username with your actual cPanel username.

Website cache – incorrectly configured caching plugins may cause disk space usage issues as well.
We strongly recommend using just one caching plugin per website at a time. Usually, cached files are stored in the plugin’s cache folder, be advised to flush the plugin’s cached data from time to time.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Disk space

Disk space is the amount of server disk space allotted per hosting account by a hosting company....

What is an index page?

The index page is the URL or local file that automatically loads when a web browser starts and...

Point your domain to a simple "Coming soon" page

Using Edit 1. Log into cPanel and navigate to File Manager menu in Files section: 2. Navigate...

How to create and download website backup automatically

Create a directory called /backup under the /home directory of your cPanel account: Then,...

How to use the Browser Console

Browser Console Browser Console is the analog of command-line interface, but for the whole...