List of files safe to remove to free up disk space on cpanel

Avatar
  • updated
  • Answered

I've been trying to see where I can find a list of files (file manager) that are safe to delete in cpanel and that will free up disk space.  For example, I see .log, .sock that are more than 5yrs old. Not sure if I should remove them.  Older .htaccess and cache files.  I read somewhere that there are commands to manage these things such as this code to get rid of tmp files.  Also in the past one of the tech support reps gave me commands to check for duplicate files.  Where would I insert these commands.  I also read that there is a way to set settings to rid of non important files within 30 days, etc.   I'm constantly trying to review cpanel forums and others to find an answer.  Thanks in advance for you help.

rm -fv /home/*/tmp/Cpanel_* 
Pinned replies
Avatar
anonymous
  • Answer
  • Answered
Quote from agabby

Hello.. this was my post originally. Didn't realize that I wasn't logged in.  but, are you listing files that are save to remove or NOT?  Thanks

a

Hi Agabby, the files listed are the ones that are in cPanel by default. I believe the intent here was that, using this list, you would know which files came with cPanel, and which had been added by you or the site administrator as a way to prioritize what to keep. We can't directly advise you on which files to delete, as everyone's site configuration is different and we don't know what you prioritize. That said, you may want to review the official cPanel documentation for things like log files to get an idea of what may not be useful to you. Hope that helps!

Avatar
anonymous
  • Answer
  • Answered
Quote from agabby

Hello.. this was my post originally. Didn't realize that I wasn't logged in.  but, are you listing files that are save to remove or NOT?  Thanks

a

Hi Agabby, the files listed are the ones that are in cPanel by default. I believe the intent here was that, using this list, you would know which files came with cPanel, and which had been added by you or the site administrator as a way to prioritize what to keep. We can't directly advise you on which files to delete, as everyone's site configuration is different and we don't know what you prioritize. That said, you may want to review the official cPanel documentation for things like log files to get an idea of what may not be useful to you. Hope that helps!

Avatar
agabby

Hello.. this was my post originally. Didn't realize that I wasn't logged in.  but, are you listing files that are save to remove or NOT?  Thanks

a

Avatar
IMH Support Agent 1
  • Under review

Hello,

Thank you for contacting us for a list of files it is safe to remove from cPanel to free up disk space. Before proceeding, I first recommend creating a full cPanel backup and downloading it then removing it from your account to save space. That way you can always restore any files or folders if needed.

Now that you have backed up your cPanel, here is a list of default files, folders, and symlinks included in your cPanel. 

Important: Keep in mind that if your website has created additional directories or you have created subdomains or added files and folders they should also not be removed. Due to this you should remove and delete files very carefully and at your own risk.

Hidden Directories:

  • /.cpaddons
  • /.cpanel
  • /.cphorde
  • /.htpasswds
  • /.imh
  • /.pki
  • /.softaculous
  • /.spamassassin
  • /.subaccounts
  • /.trash
  • /.wp-cli

Unhidden Folders:

  • /cpanel3-skel
  • /etc
  • /logs
  • /mail
  • /ssl
  • /tmp
  • /public_html
  • /public_ftp
  • /perl5

Symlink:

  • access-log
  • www

Hidden files

  • .bash_logout
  • .bash_profile
  • .contactemail
  • .gemrc
  • .lastlogin
  • .spamassassinboxenable
  • .spamassassinenable
  • .wp-toolkit-identifier

It's difficult to say whether you should remove the .htaccess file since it was most likely created/used by your website and may contain rules that are needed. 

If you have root access, you have the ability to delete unmanaged log files on your server via command line. To do that you would need to connect to our server via SSH. Let us know if you have any further questions.

Thank you,

John-Paul