Where Mautic actually stores media and why it grows
Mautic is a marketing automation platform, so most of its storage pressure comes from two distinct areas that behave very differently. The first is the media library, which lives under media/images/ inside your Mautic document root. Every logo you upload, every image embedded in an email template, and every graphic placed on a landing page lands here. Mautic does not aggressively deduplicate these files, so re-uploading the same hero image across several campaigns leaves multiple near-identical copies occupying disk space.
The second area is the asset storage directory, typically media/files/ (and the private asset path configured in your Mautic settings). Assets are the downloadable files you attach to download links in campaigns "PDFs, whitepapers, zipped resources. These are frequently much larger than images and are the usual culprit when a Mautic account unexpectedly nears its disk quota on shared hosting. Because assets are often versioned manually (guide-v1.pdf, guide-v2.pdf, guide-final.pdf), old revisions accumulate silently.
There is a third, less obvious storage consumer: Mautic's cache and temporary working directories. The compiled container and template cache sits in var/cache/prod/, and image manipulation produces resized variants that are written to disk. On CloudLinux shared hosting you are governed by both a disk quota and an inode limit (the maximum number of files and folders). Mautic's cache can generate thousands of small files, and it is entirely possible to hit the inode ceiling long before you exhaust your gigabyte allowance. When that happens, uploads fail, cache rebuilds break, and the interface throws write errors even though the disk usage figure looks reasonable.
Understanding this split matters because the optimization approach differs for each. Images benefit from compression, correct sizing before upload, and efficient browser caching. Assets benefit from housekeeping and sane upload limits. Cache benefits from periodic clearing. None of this requires root, a package manager, or server configuration files "everything below is achievable through the DirectAdmin File Manager, phpMyAdmin, .user.ini, .htaccess, and the Mautic Configuration screen.
Raising upload limits correctly with .user.ini and PHP Selector
The most common storage-related complaint is that a legitimately sized image or PDF refuses to upload. Mautic surfaces this as a vague failure, but the underlying cause is almost always a PHP ceiling. Four directives interact here: upload_max_filesize, post_max_size, memory_limit, and max_execution_time. The post size must be larger than the upload size, because the multipart request carries form fields in addition to the file itself.
On Hostiso's LiteSpeed and CloudLinux stack, the clean place to set these is the PHP Selector inside DirectAdmin, or a per-directory .user.ini file. In DirectAdmin, open PHP Selector (or Select PHP Version under the Extra Features group), switch to the Options tab, and adjust the values directly. These changes apply to your account's PHP handler without touching any server-wide file. If you prefer a file-based approach, create or edit .user.ini in your Mautic document root:
upload_max_filesize = 64M
post_max_size = 72M
memory_limit = 256M
max_execution_time = 120
max_input_time = 120LiteSpeed reads .user.ini per directory, and the file is cached for a short interval (controlled by user_ini.cache_ttl), so changes may take a few minutes to register. Avoid setting these numbers absurdly high. A 64 MB image upload is almost never justified in a marketing platform, and oversized limits simply invite bloat and make each request more memory-hungry. Match the limit to the largest legitimate asset you distribute.
Mautic also enforces its own allowed-extension and size rules in the interface. Open Settings → Configuration → Asset Settings to review the maximum asset size and the permitted extensions, and Configuration → General Settings for allowed image extensions. If PHP permits a 64 MB upload but Mautic's asset size is capped at 6 MB, the Mautic value wins. Keep the two aligned so the error you see is the one you expect, and so you are never debugging a PHP limit that is actually a CMS limit.
Serving images efficiently with LiteSpeed caching and .htaccess
Once media is uploaded, the goal shifts to serving it cheaply. Mautic's images are static files, and static files should never hit PHP on repeat requests. LiteSpeed Web Server honours standard Apache-style directives in .htaccess, so you can apply aggressive browser caching and compression to the media directory without any server-level access.
Create a dedicated .htaccess inside media/images/ with far-future expiry headers. Because Mautic generates unique filenames and you rarely overwrite an image in place, long cache lifetimes are safe:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
</IfModule>
<IfModule mod_headers.c>
Header set Cache-Control "public, max-age=31536000, immutable"
</IfModule>SVG and font files compress well, but already-compressed formats such as JPEG, PNG, and WebP do not, so only enable text compression for markup and CSS, not for raster images. If you want LiteSpeed's compression applied to the HTML Mautic generates for landing pages, add this at the document root rather than in the image folder:
<IfModule LiteSpeed>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/css application/javascript image/svg+xml
</IfModule>
</IfModule>On the format question, be realistic about what Mautic supports. Mautic does not ship a built-in WebP or AVIF conversion pipeline, and it does not generate responsive image srcsets the way a modern CMS theme engine might. Converting images to WebP is worthwhile, but you do it before upload: export your graphics as optimized WebP or compressed JPEG/PNG from your image tool, then upload those files directly. Do not expect Mautic to transcode them for you, and do not install unsupported third-party conversion hacks on shared hosting. The practical win is discipline at upload time plus the caching headers above, which together cut bandwidth and repeat-render cost dramatically.
A CDN is the other legitimate lever, but only if your architecture supports it. Mautic builds tracking and image URLs from its configured Site URL, and rewriting those to a CDN hostname can break open-tracking pixels and asset download analytics if done carelessly. If you front your site with a CDN, scope it to static assets and verify that tracking pixels and asset links still resolve through the canonical domain before relying on it. The same principle appears in our guide on Invoice Ninja media and storage optimization, where static-versus-dynamic URL handling determines whether offloading helps or breaks the application.
Housekeeping: reclaiming disk, inodes, and clearing cache safely
Storage optimization is mostly ongoing hygiene. Start by measuring. In DirectAdmin, the dashboard shows your disk and inode usage; the File Manager lets you sort folders by size. The usual offenders are media/files/ (stale assets), media/images/ (duplicate uploads), and var/logs/ plus var/cache/.
For assets, treat the Mautic interface as the source of truth. Delete unused downloadable assets from Components → Assets rather than removing files blindly in File Manager, because Mautic tracks each asset in the database and orphaned records cause broken download links. Once an asset is deleted in the UI, confirm the underlying file is gone from media/files/.
The compiled cache can be cleared safely and will rebuild on the next request. Mautic provides a console command, php bin/console cache:clear --env=prod, which you can run from DirectAdmin's terminal feature or a cron entry if your plan exposes one. If command execution is not available, deleting the contents of var/cache/prod/ through File Manager achieves the same result "Mautic regenerates the cache automatically. This is also the fastest way to recover from inode exhaustion, since the cache is usually where the file count balloons.
For logs, Mautic writes to var/logs/mautic_prod.log (and dated variants). These grow steadily and are pure overhead once reviewed. After checking them against your account's error_log for any upload or permission failures, truncate or delete the older rotated files. Permission problems on media directories show up here as write failures; the folders under media/ should be writable by your hosting user, which on CloudLinux is the account owner "never set them to 0777, as 0755 for directories and 0644 for files is both sufficient and safer.
Finally, prevent future bloat rather than cleaning it repeatedly. Agree on a naming convention for assets so old versions are obvious, resize and compress images before upload, keep the Mautic asset size limit tight, and schedule a monthly File Manager review of the three heavy directories. Combined with the caching rules and sensible upload limits above, this keeps a Mautic install comfortably within shared-hosting disk and inode quotas while serving media quickly through LiteSpeed.