Skip to content

cPanel account skeleton directory — putting default files into every new account

cPanel's skeleton directory drops files into every newly created account's home. It is the supported way to deploy boilerplate — index pages, error templates, robots.txt — without scripting.

A reseller wants every new customer’s site to start with a branded “this site is under construction” placeholder, a robots.txt that allows search engines, and an .htaccess that turns on gzip. The first instinct is a postwwwacct hook that copies files in. The cleaner answer is cPanel’s built-in skeleton directory — drop files there once, and every createacct for accounts owned by that reseller gets them.

What’s happening

cPanel maintains a per-reseller skeleton directory at /var/cpanel/skel/<reseller>/. When createacct runs and the new account’s owner has a skeleton directory, the contents of skel/<reseller>/ are copied into the new home directory, respecting paths under public_html, etc, and so on. There’s also a global default at /var/cpanel/skel/default/ that applies when the owner has no per-reseller skeleton. The mechanism predates the Standardized Hooks system; it still works and survives upgrades.

How to verify

Inspect the current skeleton state:

ls -la /var/cpanel/skel/
ls -la /var/cpanel/skel/default/public_html/
ls -la /var/cpanel/skel/acmevpn/public_html/
whmapi1 listaccts search=acmevpn searchtype=owner | head
cat /var/cpanel/skel/acmevpn/public_html/index.html

The directory layout under skel/<reseller>/ mirrors what will land in the home directory. Anything you put at skel/acmevpn/public_html/index.html becomes /home/<newuser>/public_html/index.html at create time.

The fix

  1. Create the directory if it doesn’t exist: mkdir -p /var/cpanel/skel/acmevpn/public_html/.
  2. Drop the boilerplate files in: an index.html placeholder, a robots.txt, a .htaccess with the reseller’s default rules, any error pages they want. Treat the directory like a starter site.
  3. Set ownership correctly: the files in skel/ should be owned by root:root with 644 mode. cPanel copies and re-chowns them to the new account’s user at create time; if they’re not readable to root, the copy fails silently.
  4. Test with a throwaway account: whmapi1 createacct user=test-skel-2026 domain=test-skel.example.com plan=default owner=acmevpn. Confirm /home/test-skel-2026/public_html/index.html matches what’s in the skeleton.
  5. Update the skeleton when boilerplate changes. The skeleton is not retroactive — existing accounts are not modified when you change skel/. If you need to push the change to existing accounts, use a separate one-off script.
  6. For the default skeleton across all resellers, put files in /var/cpanel/skel/default/. Per-reseller skeletons override default at create time.

For shops running consistent customer onboarding across many resellers, Stack Harbor’s agency partner practice maintains the skeletons in config management so the boilerplate stays current and consistent across the fleet.