Understanding the .cagefs Folder in CloudLinux (cPanel Hosting)
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.
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
"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!


