Take the 2-minute tour ×
Joomla Stack Exchange is a question and answer site for Joomla! administrators, users, developers and designers. It's 100% free, no registration required.

My joomla website currently uses about 100 MB of storage. I checked my folders and found out that the tmp folder is about 30MB and contains a number of files and folders named like "install_320e535e4332c2. Some of these files are more recent, while others seems to be much older (more than 1 month).

I checked a clean Joomla install and found this folder empty.

  • What is the actual need for this folder?
  • Would it be okay to delete its content on my live site?
share|improve this question

3 Answers 3

up vote 6 down vote accepted

You can definitely delete the files in the tmp directory and actually it is strongly recommended to do so and maintain it clean. You should only keep the index.html file in place, that may prevent potential directory listing of the files.

The tmp (temporary) folder is used by Joomla and its extensions when performing software installations or during the system is handling files and needs a location to temporarily store them. In many cases these files get stuck in the tmp folder. Apparently this may result to HD space issues, but there is also another bigger risk.

Since these files may come from old extensions once installed in your website, they can contain old vulnerable and insecure code. They can also be any kind of executable php files, or can contain other sensitive information which can be exposed.

Although your other security settings and your server configuration may be a safeguard, the best practice is to delete such files and keep your website clean, something that you should periodically perform.

As mentioned above, you should only keep the index.html file. For enhanced security you could also place an .htaccess file with rules to prevent web access to the folder.

About tmp directory permissions.

As said, tmp folder is used by the Joomla System during installation. It's common situation when insufficient permissions or a wrong entry in the configuration for the path of the tmp directory, will cause installations to fail. In such case make sure that you have correctly set the path in the configuration file for the tmp directory and it has sufficient permissions.

Auto-Cleaning the tmp directory

For an automated process of auto-cleaning the tmp folder alongside with Lodder's suggestion for Akeeba Admin Tools, I would recommend NoNumber's Cache Cleaner plugin which provides a special setting for the tmp folder as well.

share|improve this answer
1  
You beat me to it. Would also maybe mention that Admin Tools can also be used to clean the temp directory :) –  Lodder Aug 18 at 10:08
    
I leaved this out of my answer, to leave space for more nice answers that will add value here. –  FFrewin Aug 18 at 10:12

In addition to @FFrewin's answer, if you do not have FTP access, you can clean the tmp folder using Admin Tools. The option for this is located on the Admin Tools control panel as shown in the below screenshot:

enter image description here

As mentioned by FFrewin, the Pro version of Admin Tools allows you to perform a scheduled clean up of the tmp directory.

In addition to this, you can also install an extension from the tmp folder, by following these steps:

  1. In your tmp directory, create a new folder, for example helloworld
  2. Extract your zip file on your computer and upload the contents to this newly created folder. Depending on your FTP client, you could firstly upload the zip file and then extract it.
  3. In the Joomla backend, go to Extensions >> Extension Manager and on the tabs below, select Install from Directory.
  4. You will see a predefined path, such as /home/xxx/public_html/tmp which you simply need to add your newly created folder on to, so it would be /home/xxx/public_html/tmp/helloworld
  5. Click Install
share|improve this answer
    
Great addition the option to install an extension from the tmp folder - which I totally forgot to mention in my answer! –  FFrewin Aug 18 at 10:32
1  
Regarding the Admin Tools: The admin tools plugin (maybe the Pro version) provides settings to auto-perform cleanups to the tmp folder periodically. –  FFrewin Aug 18 at 10:33
    
Wasn't aware of that, nice little feature to have. Updated the above –  Lodder Aug 18 at 10:36

The "tmp" folder is a place for the system to store files on a temporary basis. One of the most frequent uses of this folder is when extensions are installed. When a new extension is installed, a copy of the extension's archive file is copied into the "tmp" folder and then is unpacked into the correct Joomla folders.

The install process doesn't clean itself up automatically all the time. Most of the time it will. If you are using the Joomla installer, it depends on how the component's author wrote the install instructions. Most of the time you don't need to do anything and when you quit adding modules and components, you won't have to worry about it.

If you do a lot of component installations and reinstallations it will collect a lot of miscellaneous session files, plus copies of zip files. So checking it periodically isn't a bad idea.

Either you do it using ftp or the file manager (as mentioned in details by friends up in this page or cron if you know how) or if you have Akeeba Administrative Tools installed there is a button on its control panel that will clear the temp directory for you.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.