/tmp directory overview

Overview

Web servers have a directory named /tmp used to store temporary files. Many programs use this /tmp directory for writing temporary data and generally remove the data when it is no longer needed. Otherwise, the /tmp directory is cleared when the server restarts.

Shared servers

On shared servers, the /tmp directory is shared among all customers on the server.

When the /tmp directory becomes full, some programs stop working. For example, it is no longer be possible to upload a file to a site since there is no room in the /tmp folder to store the temporary file while it's uploading.

Creating your personal /tmp directory

To maintain control of the temporary storage for files and add security for things such as sessions, you can configure the software to use any directory you want for temporary storage. Making this directory within your own user space (outside the web-accessible directory) is often desirable. For example, create a /tmp directory in the following location. Make sure to change username to your Shell user.

/home/username/tmp

Here you can control the /tmp directory while your files are protected from view by others on the server. You would control this directory based on the programming language your site is using. For example, if your site is using PHP, view the following link:

See also

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?