Era Host hosting
EraHost – Free Domain, Cheap Hosting!
Client Area
Support 24/7
Menu

Understanding the .cagefs Folder in CloudLinux (cPanel Hosting)

2 min read
04.08.2025

What is the .cagefs Folder?

The .cagefs folder is a CloudLinux CageFS directory that exists in each cPanel user's home directory. It provides a virtualized, secure file system to isolate users from each other.

.cagefs Folder CloudLinux cPanel Guide
.cagefs — CloudLinux's per-user file-system jail under cPanel.

For other cPanel/CloudLinux stack guides, see cpsrvd — cPanel Service Daemon and cpsess in cPanel & WHM.

Location of .cagefs Folder:

/home/username/.cagefs/

Key Functions of .cagefs:

  • Prevents privilege escalation (users can't access others' files).
  • Secures system files (protects /etc, /bin, /usr from unauthorized access).
  • Limits resource usage (prevents one user from overloading the server).

Common Issues & Fixes Related to .cagefs

.cagefs Folder is Missing or Incomplete

If .cagefs is missing or corrupt, users may experience website errors, permission issues, or missing commands.

Fix: Remount CageFS for the User

cagefsctl --force-update
cagefsctl --remount username

Replace username with the actual cPanel username.

If the issue persists, fully disable and re-enable CageFS for that user:

cagefsctl --disable username
cagefsctl --enable username
cPanel Hosting
Full control over your website
  • Convenient
  • Simple
  • Fast
  • Free 7-day trial
cPanel Hosting

"Permission Denied" Errors in .cagefs

If a user cannot access files inside .cagefs, it could be due to incorrect permissions.

Fix: Reset Permissions

cagefsctl --remount username
chmod -R 755 /home/username/.cagefs

To apply to all users, run:

cagefsctl --remount-all

Restart services after fixing permissions:

service cpanel restart

"Command Not Found" Inside CageFS

Sometimes, users inside CageFS cannot run basic commands like php, ls, or wget.

Fix: Rebuild the CageFS Skeleton

cagefsctl --update

If that doesn't work, reinitialize the CageFS environment:

cagefsctl --reinit

Check if commands are available after the update.

Remove .cagefs for a User (Disable CageFS)

If you need to disable CageFS for a specific user:

Disable CageFS for One User

cagefsctl --disable username

Disable CageFS for All Users

cagefsctl --disable-all

Disabling CageFS removes security protections, so do this only if necessary.

Summary of Fixes

Issue Fix
.cagefs missing or incomplete Run cagefsctl --force-update && cagefsctl --remount username
Permission denied in .cagefs Run chmod -R 755 /home/username/.cagefs
Commands not working in CageFS Run cagefsctl --update or cagefsctl --reinit
Disable CageFS for a user Run cagefsctl --disable username

Now CageFS should work properly, and your users will be securely isolated!

Frequently asked questions
CageFS hides binaries from users that aren't on the per-user allowed-binaries list. Edit `/etc/cagefs/conf.d/.cfg` to add the binary path, then `cagefsctl --remount-all`. For one-off allowance per user: `cagefsctl --enter ` to test. Don't run `--disable` for the whole server just to give one user one tool.
Most .cagefs contents are bind-mounted per-user views; the underlying inodes are shared. Real disk use is in the user's actual files. `du -sh /home/` is the real number. If .cagefs itself is bloating, check `/var/cagefs/skeleton/` for stale binaries — `cagefsctl --update --force` rebuilds the skeleton cleanly.
Yes: `cagefsctl --disable `. The user gets normal shell access without the jail. Use cautiously — it gives them visibility into other users' processes via /proc and removes the main shared-hosting isolation. Reserve for users you trust completely (your own admin accounts, internal scripts).
Add the custom PHP binary path to `/etc/cagefs/conf.d/.cfg` under `[binaries]` and `[paths]` (data files). Then `cagefsctl --update --force` and `cagefsctl --remount-all`. CloudLinux's docs detail the binary-allowance format. Common gotcha: missing the libs in `[paths]` — binary launches but can't find its shared libs.
Related articles
CloudLinux Hosting: Why Is It Secure Hosting and How Is It Protected?
Understanding .cagefs in cPanel — What It Is and How to Fix Issues
Understanding .cagefs/tmp in CloudLinux CageFS