Joomla disk space full: find what fills your hosting
Old backups, a full tmp folder, logs, cache and full-size photos fill most Joomla hosting. Find the biggest folders first, then clean up in this order.
Your host mails that the account is at 95 percent, or Joomla suddenly refuses to save an upload. On almost every Joomla site the space goes to the same handful of things: backup archives, the tmp folder, logs, cache and full-size photos. You can track them down by hand with the steps below, or let our own Treesize module show the biggest folders on the control panel.
First check what the hosting number counts
The figure in your hosting panel is usually the whole account: the website files, but also mailboxes, the databases and the server logs. A site of 2 GB can sit in an account of 10 GB because one mailbox keeps every attachment since 2015. Open the disk usage page of the panel (cPanel and Site Tools both have one) and see how the total splits into files, mail and databases before you start deleting anything in Joomla.
Find the biggest folders
With SSH access, go to the web root and let the server sort the folders by size:
cd ~/public_html
du -h --max-depth=1 | sort -h
find . -type f -size +50M -exec ls -lh {} \;
The first command lists every top-level folder with its size, biggest last. Run it again inside the largest folder until you find the one that grows. The second lists single files over 50 MB, which is where forgotten archives show up. Without SSH, the file manager of the hosting panel can often show folder sizes too, but it is slow on a site with many small files.
The usual suspects, in order of size
Backup archives
This is the winner on most sites. A backup component that runs every night and never deletes anything fills the disk in a few months. Akeeba Backup stores its archives in administrator/components/com_akeebabackup/backup unless you set another output directory. Set a quota in the backup profile (keep the last five, for example) and download the archives you want to keep. A backup that sits on the same server as the site does not protect you anyway, as the article on backups explains.
Also look in the web root for files like site-old.zip, backup.sql or a folder called old or test. Those are usually copies someone made before a migration. They take space and they are a security risk, because anyone who guesses the name can download them.
The tmp folder
Joomla unpacks every extension and every core update in the folder set under System > Global Configuration > Server > Path to Temp Folder. A successful install cleans up after itself, a failed one does not. After a few broken updates you find several copies of the full Joomla package there. You can empty the folder when no install or update is running. Keep the folder itself, and keep it writable, or the next install fails.
Log files
The log folder is set in the same place under Path to Log Folder, by default administrator/logs. With debug logging switched on, or an extension that writes everything it does, a log file can grow to gigabytes. Delete what you do not need and switch off the logging that caused it. Joomla has a Scheduled Task for this: System > Scheduled Tasks > New, choose Rotate Logs and set Maximum Logs to the number of old files you want to keep. The article on Scheduled Tasks covers how those tasks get triggered.
Cache
The cache and administrator/cache folders are rebuilt automatically, so emptying them is safe. With page caching on a large site the cache can hold a file for every URL and every language. Use System > Maintenance: Clear Cache for everything, or Clear Expired Cache to remove only the files that are out of date anyway. If it fills up again within days, the cache time is too long or a crawler is requesting thousands of URL variations.
Full-size photos
Editors upload photos straight from a phone or camera: 6000 pixels wide and 8 MB each, shown on the site at 800 pixels. Joomla has a Scheduled Task for that as well. Create a new task of the type Image Size Check, pick the Directory under images, and set Limit (px) (default 1080) and the maximum number of images per run. Every image larger than the limit is resized. The task overwrites the original file, so take a backup of the images folder first.
The database
If the hosting quota counts databases, look at the table sizes in phpMyAdmin. The usual big ones are the session table, the action logs and the Smart Search index. The Scheduled Tasks Session Data Purge and Delete ActionLogs keep the first two in check.
What not to delete
Leave media, libraries, administrator/components and the template folders alone, even if they look big: they are part of Joomla and the extensions you use. Never delete the cache, tmp or logs folder itself, only its contents. And remove a backup archive only after you have a copy of it somewhere else.
Checklist
- Check in the hosting panel whether files, mail or databases take the space
- Find the biggest folders with
du, the file manager or our own Treesize module - Set a quota on backups and move old archives off the server
- Remove old zip files, SQL dumps and copies from the web root
- Empty tmp, logs and cache, and add the Rotate Logs task
- Shrink oversized photos with the Image Size Check task, after a backup
Doctor Joomla is a project of Cloudfaction, a Dutch agency building and maintaining Joomla sites since 1999. The articles are made with the help of AI, so tell us if something does not match your screen. Mail info@cloudfaction.nl if you want someone to look at yours.