When new accounts are created in cPanel/WHM, the system automatically copies a set of default files from the skeleton directory into the user’s home directory. This mechanism is often overlooked, but with some creativity, it can become a powerful way to automate onboarding, enforce standards, and pre-deploy useful files.
Where Is the Skeleton Directory?
By default, the skeleton directory lives at:
Anything inside this directory is copied to the home directory of a new account.
-
/root/cpanel3-skel/public_html/index.html
→ becomes/home/username/public_html/index.html
-
/root/cpanel3-skel/.bashrc
→ becomes/home/username/.bashrc
Common Skeleton Customizations
1. Branded Default Index Page
Replace cPanel’s generic placeholder with your own:
Your default index page might include:
-
Company branding and logo
-
Links to support docs
-
Instructions for uploading a website
2. Preloaded .bashrc
, .zshrc
, or .profile
For accounts with SSH access:
Include:
-
Helpful aliases (e.g.,
alias ll='ls -lah'
) -
Custom MOTD with support contact info
-
Path additions for developer tools
3. SEO and Security Defaults
Drop default .htaccess
and robots.txt
files into the skeleton:
Examples:
-
Block access to
.git/
,.env
, and config files. -
Disallow indexing for staging domains.
4. Git-Ready Directories
Pre-populate Git configs:
You can also include example hooks in:
5. Developer Starter Kits
For developer-friendly hosting, seed each account with a starter project structure:
Examples:
-
Node.js boilerplate
-
PHP framework stubs (Laravel, CodeIgniter)
-
Python/Flask starter files
6. CMS Defaults
For WordPress-heavy environments, preload:
This makes onboarding faster for clients who install WordPress.
7. Compliance and Legal
Automatically deploy a placeholder for terms, policies, or compliance files:
Ideal for GDPR/CCPA environments.
8. Cron Job Templates
You can preload cron files for accounts that need scheduled cleanup or reports. Place the file in the skeleton and adjust ownership after account creation. Example:
This can include tasks like clearing tmp/
or rotating logs.
Advanced Trick: Package-Based Skeletons
By default, all accounts use the same skeleton directory. But what if you want different files depending on the hosting package? For example:
-
WordPress Plan → WordPress starter files
-
Developer Plan → Git, Node.js, or Laravel boilerplate
-
Basic Plan → Only a branded index page
Here’s how to set it up.
Step 1: Create Multiple Skeleton Directories
Make separate directories for each package:
Populate each directory with the desired defaults.
Step 2: Write a Hook Script
cPanel supports Account Creation Hooks. These scripts run automatically after a new account is created.
Example hook (/usr/local/cpanel/hooks/postacctcreate-skel.pl
):
Make it executable:
Step 3: Register the Hook
Run:
This ensures the script runs after every new account creation.
Step 4: Test It
-
Create a new account using the “WordPressPlan” package.
-
Confirm that WordPress starter files appear in the home directory.
-
Repeat for DeveloperPlan and BasicPlan.