Configuring CloudLinux & CageFS in cPanel: A Guide
Learn how to install CloudLinux, set up CageFS, and configure LVE resource limits on an AlmaLinux 9 cPanel server for stable hosting.
5 min read
Managing a shared hosting server or a multi-tenant environment often brings a familiar challenge: a single resource-heavy website can consume all available CPU and RAM, slowing down or crashing every other site on the server. If you run a web hosting business or manage multiple client websites on a cPanel server, securing resource boundaries is critical for stability.
CloudLinux OS, combined with CageFS and the LVE (Lightweight Virtual Environment) Manager, provides a robust solution to this problem. It virtualizes the file system per user and lets administrators set hard limits on CPU, memory, and I/O operations.
In this guide, we will walk through the process of installing and configuring CloudLinux, setting up CageFS, and managing user limits using the LVE Manager within cPanel on an AlmaLinux 9 server.
Understanding CloudLinux, CageFS, and LVE
Before diving into the configuration steps, it helps to understand the core components that make user isolation possible:
CloudLinux OS: An operating system built specifically for shared hosting providers, derived from enterprise Linux distributions.
LVE (Lightweight Virtual Environment): A kernel-level technology that tracks and limits resource usage (CPU, memory, IOPS) for each individual user account.
CageFS: A virtualized file system that encapsulates each user in their own secure jail. Users cannot see other users, sensitive configuration files, or other accounts on the same server.
When combined with cPanel, these tools ensure that a traffic spike or poorly optimized PHP script on one account only affects that specific user, leaving the rest of the server fully operational.
Prerequisites and Installation
To follow this guide, you need a dedicated server or VPS running AlmaLinux 9 with a fresh installation of cPanel & WHM. CloudLinux must be installed on a supported, clean operating system before cPanel is installed, or converted from an existing AlmaLinux installation using the official CloudLinux deployment script.
Connect to your server via SSH as the root user to begin the verification and setup process. These steps are tailored specifically for AlmaLinux 9.
First, verify that your system is running the CloudLinux kernel by executing the following command:
uname -r
This command prints the active Linux kernel version. If CloudLinux is installed correctly, the output will include the specific CloudLinux kernel identifier (containing "lve").
Next, install the LVE Manager and associated utilities using the package manager:
dnf install lve-manager -y
This command installs the LVE Manager package and its dependencies, integrating resource management directly into your WHM interface.
Enabling and Configuring CageFS
CageFS prevents users from viewing files outside their home directory, stopping local file inclusion attacks and unauthorized data browsing. Once the base packages are installed, you must deploy and enable CageFS.
Install the CageFS package via the command line:
dnf install cagefs -y
This command downloads and installs the CageFS virtual file system components on your AlmaLinux 9 server.
Now, initialize CageFS to create the skeleton file system templates:
cagefsctl --init
This command sets up the initial virtual file system structure that will house your users.
By default, users are not automatically placed inside the cage. You can enable CageFS for all existing cPanel users with the following command:
cagefsctl --enable-all
This command activates CageFS containment for every active user account currently hosted on the server. For any new cPanel accounts created in the future, CageFS will be enabled automatically.
Setting Default LVE Limits in WHM
With CloudLinux and CageFS active, you can define resource limits to prevent any single account from overwhelming the server. While limits can be customized per user, setting sensible default limits applies a safety net across the entire environment.
To configure these limits:
Log in to your WHM interface as the root user.
In the left-hand search sidebar, type LVE Manager and click on it.
Navigate to the Users tab or click on Settings to configure global defaults.
Adjust the default metrics to match your server hardware capacity.
Pay close attention to the following core resource parameters:
CPU Usage: Determines how much processing power a user can consume. This is usually measured as a percentage of a single core (e.g., 100% equals one full core).
Physical Memory (RAM): Sets the maximum amount of RAM a user can use at any given time. If exceeded, processes may throw out-of-memory errors or experience slowdowns.
IOPS (Input/Output Operations Per Second): Limits how fast a user can read from and write to the disk, preventing disk bottlenecks.
Number of Processes (EP / nproc): Limits concurrent entry processes (like active Apache or PHP requests) to mitigate denial-of-service or heavy bot traffic impact.
Isolating and Customizing Limits for Specific Accounts
Not all websites have the same resource requirements. A static HTML portfolio needs very few resources, while an active e-commerce store running WooCommerce requires higher limits to handle database queries and checkout sessions smoothly.
You can easily override default limits for individual cPanel users through the LVE Manager:
Open LVE Manager in WHM.
Click on the Users tab to view a list of all cPanel accounts on the server.
Find the specific user account you want to modify and click the Edit (pencil) icon next to their username.
Modify the CPU, RAM, IOPS, or concurrent connection limits as needed for that specific client.
Click Save to apply the changes immediately without requiring a server reboot or service restart.
Tip: Monitor the LVE Manager's "Current Usage" tab during peak traffic hours. This helps you identify accounts that frequently hit their limits so you can adjust their allocations or suggest optimizations to the website owner.
Conclusion
Configuring CloudLinux and CageFS on an AlmaLinux 9 cPanel server is one of the most effective ways to maintain high availability and reliability. By establishing strict resource boundaries with the LVE Manager, you protect your infrastructure from runaway scripts, unexpected traffic spikes, and abusive users. Taking the time to properly tune CPU, RAM, and IOPS limits ensures a stable, predictable hosting environment for every website on your server.