/home/<user>/.cpanel is the hidden directory where cPanel stashes per-account caches: caches.json files, datastore artifacts, nvdata for interface state, sometimes a stray older-version backup of a config. When a user reports their usage looks wrong and du -sh of public_html and mail doesn’t add up to the displayed total, the missing bytes are often in .cpanel.
What’s happening
cPanel writes session state, command output caches, and quota intermediate data into this directory. Most of it is regenerable. A few things are not — nvdata holds UI state like the last-used WHM interface tabs, which is annoying to lose but not damaging. The risk is in subdirectories used by third-party plugins (e.g. some imunify360 or SSL automation modules) that store working state there.
How to verify
Inspect before touching:
du -sh /home/<user>/.cpanel
du -sh /home/<user>/.cpanel/* | sort -h
find /home/<user>/.cpanel -type f -size +10M
ls -la /home/<user>/.cpanel/datastore/
A 4 GB .cpanel on a small account is almost always a runaway datastore or a forgotten file-manager temporary directory. Identify the heavy subdirectory before deleting wholesale.
The fix
- The safe pass: clear
~/.cpanel/datastore/contents and~/.cpanel/caches/*. These regenerate on next cPanel session.rm -rf /home/<user>/.cpanel/datastore/* /home/<user>/.cpanel/caches/*. Avoid removing.cpanel/nvdataunless you confirm what’s there. - For the file manager temp directory (
/home/<user>/.cpanel/cron_clearedcache_runand similar), inspect first — there may be uploads in progress. - After cleanup, refresh the cPanel cache with
/usr/local/cpanel/bin/quota_cache --user=<user> --rebuildand check the displayed usage matchesdu -sh /home/<user>. - If usage still looks wrong, the candidate is
~/.trash(cPanel File Manager trash, separate from the OS) —du -sh /home/<user>/.trashand clean if confirmed. - Document the cleanup in the ticket and the customer’s account notes. Repeated clean-the-cache passes on the same account suggest something is producing the bloat on a schedule — find the producer rather than rerunning the cleanup.
For shared servers where this cleanup is a regular interruption, Stack Harbor handles it under WHM server management as part of routine operations.