Skip to content
  • About
  • Contact
  • Docs
  • Features
  • Home

Configurations

5
  • Setup RAID Level 6
  • Setup RAID Level 5
  • How To Add Swap on RHEL or Centos based system
  • Website Migration to Non-Panel OpenLiteSpeed Server
  • Linux Server Performance Tuning

CyberPanel

9
  • Mounting /tmp on a Separate File
  • Updating CyberPanel Main VirtualHost Configuration
  • Updating CyberPanel vHosts Configuration
  • How to Change CLI PHP on CyberPanel
  • How to Update PHP Version to 8.1 in CyberPanel (From 7.3, 7.4, or 8.0)
  • CyberPanel Server Cleanup: Logs, Dumps, Backups
  • CyberPanel Full LSPHP Installation PHP 7.4 – 8.3
  • CyberPanel / OpenLiteSpeed: Clean LSPHP Session Files
  • SSL Certificate Management in CyberPanel via SSH

Hestia Control Panel

6
  • Fixing Email Bounce Back Issue in Hestia (Exim4 Blacklist Rejection)
  • Managing Fail2Ban in HestiaCP Server
  • Installing and Configuring PHP Versions in HestiaCP
  • phpMyAdmin Not Found in HestiaCP
  • Setting Up a Reverse Proxy for any Port in HestiaCP
  • How to Install Let’s Encrypt SSL in Hestia CP (Hostname, Admin Panel, and Email Server)

WHM/cPanel

6
  • Setting Up a Reverse Proxy on cPanel/WHM for Port 8081
  • How to increase the size of the cPanel-generated /tmp filesystem
  • Installing Old PHP Versions on a cPanel/WHM Server
  • Fixing “550: Your Country is Not Allowed to Connect to This Server” Error in Exim (cPanel)
  • Enable WP-CLI in CageFS on CloudLinux Servers (WHM/cPanel)
  • Securing /tmp and /var/tmp with a Dedicated Loopback Filesystem

Nagios

5
  • Service Checks
  • Uptime Checks
  • Disk Space Checks
  • Load Checks
  • Email Related Checks

WordPress

3
  • WordPress Core Reinstallation Guide
  • Managing WordPress Users via WP-CLI
  • Website Duplication, Migration, or Domain Change

Operating System

1
  • Server Reboot (RHEL or Centos based system)

AWS

1
  • How to Resize EBS Volumes on AWS

Databases

2
  • MySQL
    • Optimizing MySQL Performance
    • Recovering MySQL in Plesk When InnoDB Crashes

CloudLinux

4
  • Moving cagefs-skeleton directory
  • Enable WP-CLI in CageFS on CloudLinux Servers (WHM/cPanel)
  • Enable bc in CageFS on CloudLinux Servers(WHM/cPanel)
  • How to Upgrade MySQL 5.x to MySQL 8.0 on CloudLinux (WHM server) with MySQL Governor

Cloudflare

1
  • Configuring Security Headers in Cloudflare

ISPmanager

1
  • Install Free SSL (Let’s Encrypt) for domain.tld on ISPmanager with NGINX

Plesk

1
  • Plesk Admin Login Blocked – IP Restriction Recovery Guide

VPN

4
  • Install OpenVPN Open Source in Linux CentOS Ubuntu Debian Servers
  • Protected: OpenVPN Installation & Fix Wiki (CloudLinux / CentOS 7 & 8)
  • Outline VPN Installation & Management Guide
  • Installing AdGuard Home on Debian/Ubuntu (Docker)
View Categories
  • Home
  • Docs
  • WHM/cPanel
  • How to increase the size of the cPanel-generated /tmp filesystem

How to increase the size of the cPanel-generated /tmp filesystem

Introduction

By default, the size of the cPanel-generated /tmp filesystem is 4GB, or 5% of the /usr filesystem size, whichever is smaller. You may wish to increase the size of this filesystem so it can hold more data.

Warnings

We recommend this procedure only be performed by an advanced system administrator and only during a scheduled dedicated time since it requires temporarily stopping the services that write to /tmp.
This procedure only works on servers on which cPanel has generated /tmp. cPanel-generated /tmp filesystems have /dev/loop in their names, for example:

df -h /tmp

Filesystem Size Used Avail Use% Mounted on
/dev/loop0 477M 2.4M 449M 1% /tmp

If your server’s current /tmp filesystem does not contain /dev/loop in its name, the filesystem was created outside by cPanel by the server’s operating system or data center, and you will need to seek assistance from your data center with increasing the size of /tmp.

This procedure does not work on servers running in Virtuozzo or VZ environments.

Procedure

Log in as root, either via SSH, or WHM’s Terminal.

Open “/scripts/securetmp” in a text editor

vim /scripts/securetmp

Find and modify the ‘tmpdsksize’ value to the desired size. For example, this sets the value to 5GB:

Note: if you want to add 5 GB to /tmp, you need to calculate the size in kilobytes:

5×1024×1024= 52,42,880 KB

my $tmpdsksize = 5242880

Use “#” characters to disable this section of the script:

my $five_percent_of_available = ( $available * 0.05 );
if ( $five_percent_of_available > $tmpdsksize ) {
$tmpdsksize = $five_percent_of_available;
}

my $FOUR_GIG_k = ( 1024 * 1024 * 4 );
if ( $tmpdsksize > $FOUR_GIG_k ) {
$tmpdsksize = $FOUR_GIG_k;
}

After you’re complete, the section should look like:

# my $five_percent_of_available = ( $available * 0.05 );
# if ( $five_percent_of_available > $tmpdsksize ) {
# $tmpdsksize = $five_percent_of_available;
# }

# my $FOUR_GIG_k = ( 1024 * 1024 * 4 );
# if ( $tmpdsksize > $FOUR_GIG_k ) {
# $tmpdsksize = $FOUR_GIG_k;
# }

Check which services are currently using /tmp:
lsof | grep /tmp | grep -v deleted

Using the output from lsof, temporarily disable monitoring for the services using /tmp. For example:

whmapi1 configureservice service=cpsrvd enabled=1 monitored=0

whmapi1 configureservice service=mysql enabled=1 monitored=0

whmapi1 configureservice service=httpd enabled=1 monitored=0

Using the output from lsof, stop the services that use /tmp. For example:

/scripts/restartsrv_cpsrvd --stop

/scripts/restartsrv_mysql --stop

/scripts/restartsrv_httpd --stop
Unmount /tmp and /var/tmp:
umount -l /tmp

umount -l /var/tmp

Move /usr/tmpDSK file to another location (in case you need to mount it elsewhere to preserve data):

mv /usr/tmpDSK /usr/tmpDSK_bak

Run this script to create the larger /tmp filesystem:

/scripts/securetmp

During execution, it will ask:

Would you like to secure /tmp & /var/tmp at boot time? (y/n)  : Y
Would you like to secure /tmp & /var/tmp now? (y/n) : Y

Choose y for both:

Reload Systemd Configuration

Run the following command to apply the changes:

systemctl daemon-reload

Restart the services you stopped previously. For example:

/scripts/restartsrv_cpsrvd --start

/scripts/restartsrv_mysql --start

/scripts/restartsrv_httpd --start

Re-enable monitoring for the services. For example:

whmapi1 configureservice service=cpsrvd enabled=1 monitored=1

whmapi1 configureservice service=mysql enabled=1 monitored=1

whmapi1 configureservice service=httpd enabled=1 monitored=1
Conclusion

You’ve successfully increased the /tmp size on your cPanel server. If you run into issues, you can revert by restoring /usr/tmpDSK_bak.

Table of Contents
  • Introduction
  • Procedure
  • Check which services are currently using /tmp:
  • Unmount /tmp and /var/tmp:
  • Conclusion

Share This Article :

  • Facebook
  • X
  • LinkedIn
  • Pinterest

Was it helpful ?

  • Happy
  • Normal
  • Sad
  • About
  • Contact
  • Docs
  • Features
  • Home

© 2026 Panel Web Hosting

  • About
  • Contact
  • Docs
  • Features
  • Home