Skip to content

Designing cPanel feature lists that map cleanly to your billing plans

A discipline for cPanel feature lists — version them in git, render them per plan tier, diff before deploy, and keep the cPanel UI honest about what each customer is paying for.

A customer on your “Silver” plan files a ticket: “Why can I install Node.js apps? I’m pretty sure that’s a Gold feature.” You check WHM — sure enough, “Application Manager” is enabled on the Silver feature list. It was disabled six months ago, then somebody enabled it for one customer in a hurry, forgot to revert, and the change has been propagating to every new Silver account since. The feature list silently became the canonical definition of what Silver costs you to deliver, and nobody noticed because cPanel’s UI has 180 toggles arranged in seven tabs with no diff view.

What’s happening

A cPanel feature list is a flat file at /var/cpanel/features/<name> containing one feature name per line, set to 1 (enabled) or 0 (disabled). WHM has a UI to edit them, but the UI hides three things: it doesn’t show which features are new since cPanel last upgraded, it doesn’t show the diff between two feature lists side-by-side, and it doesn’t track who changed what when. The result is feature lists that drift — Silver picks up a feature meant for Gold, Gold loses one that was supposed to stay, and you find out from a customer ticket.

The cleaner pattern is to treat feature lists as code: version them in git, render them per plan tier from a single source of truth, and deploy them via a script that diffs the current on-disk state against the intended state and refuses to apply silently. Every cPanel package (the thing customers actually get assigned) references a feature list by name; if your feature lists are auditable, your plan tiers are auditable.

How to verify

List all feature lists on the server:

ls -la /var/cpanel/features/

Read a specific feature list:

cat /var/cpanel/features/silver
# autossl=1
# webmail=1
# nodejsselector=0
# pythonselector=0
# ...

Show which packages reference each feature list:

for pkg in /var/cpanel/packages/*; do
  fl=$(grep -E '^FEATURELIST=' "$pkg" | cut -d= -f2)
  printf '%-30s -> %s\n' "$(basename "$pkg")" "$fl"
done

List every feature that cPanel currently knows about (this is the universe your lists are drawing from):

/usr/local/cpanel/bin/whmapi1 --output=jsonpretty get_available_applications | \
  jq -r '.data.application | keys[]' | sort

That output drifts when cPanel upgrades — a new feature appears in the universe, and your feature lists silently get it (cPanel adds new features to existing lists by default, set to enabled). The whole problem starts there.

To find features that exist on the server but are missing from your silver list:

comm -23 \
  <(/usr/local/cpanel/bin/whmapi1 --output=jsonpretty get_available_applications | \
    jq -r '.data.application | keys[]' | sort) \
  <(cut -d= -f1 /var/cpanel/features/silver | sort)

Each line is a feature that defaulted to enabled on Silver because it wasn’t explicitly set.

The fix

Source-of-truth tree:

ops-repo/
  cpanel/
    feature-base.yml          # features common to all tiers
    feature-overrides/
      bronze.yml              # what changes from base for bronze
      silver.yml
      gold.yml
      platinum.yml
    render.sh                 # renders /var/cpanel/features/* from yml
    apply.sh                  # diffs + applies (with confirmation)

feature-base.yml — the default for every tier. Everything starts disabled unless explicitly enabled here:

# cpanel/feature-base.yml
# Default = 0. Only list features that are ENABLED for at least one tier.
# Per-tier overrides go in feature-overrides/<tier>.yml

features:
  # Mail
  webmail: 0
  emailaccounts: 0
  emaildiskquota: 0
  forwarders: 0
  autoresponders: 0
  mailman: 0
  emailfilters: 0
  spamassassin: 0

  # Files
  filemanager: 0
  ftpaccounts: 0
  backup: 0

  # Domains
  addondomains: 0
  parkeddomains: 0
  subdomains: 0
  redirects: 0
  dnseditor: 0

  # Databases
  mysql: 0
  phpmyadmin: 0
  postgres: 0
  phppgadmin: 0

  # Apps / languages
  nodejsselector: 0
  pythonselector: 0
  rubyselector: 0
  phpselector: 0

  # Security
  autossl: 0
  sslmanager: 0
  cphulkd: 0
  ipdeny: 0
  hotlink: 0
  twofactorauth: 0

  # Metrics / logs
  webalizer: 0
  awstats: 0
  rawlog: 0
  errorlog: 0
  bandwidth: 0

  # Advanced
  cron: 0
  ssh: 0
  apiTokens: 0

feature-overrides/bronze.yml — entry-level, mail-only:

# Bronze: mail-only, no databases, no apps
inherits: feature-base
enable:
  - webmail
  - emailaccounts
  - emaildiskquota
  - forwarders
  - autoresponders
  - emailfilters
  - spamassassin
  - filemanager
  - ftpaccounts
  - autossl
  - twofactorauth
  - bandwidth
disable: []

feature-overrides/silver.yml — adds one DB, one PHP version, basic stats:

# Silver: bronze + MySQL + PHP + AWStats
inherits: bronze
enable:
  - mysql
  - phpmyadmin
  - phpselector
  - addondomains
  - parkeddomains
  - subdomains
  - redirects
  - dnseditor
  - awstats
  - rawlog
  - errorlog
  - cron
  - sslmanager
disable: []

feature-overrides/gold.yml — Silver + apps + SSH:

# Gold: silver + Node/Python/Ruby selectors + SSH + advanced security
inherits: silver
enable:
  - nodejsselector
  - pythonselector
  - rubyselector
  - postgres
  - phppgadmin
  - ssh
  - cphulkd
  - ipdeny
  - hotlink
  - mailman
  - backup
  - apiTokens
disable: []

feature-overrides/platinum.yml — Gold tier with no restrictions:

inherits: gold
enable: []
disable: []
# platinum gets webalizer too as a legacy concession
enable_extra:
  - webalizer

render.sh — turns the YAML into actual feature list files in a staging dir:

#!/usr/bin/env bash
# cpanel/render.sh
# Reads feature-base + tier overrides and writes ./out/<tier>
set -euo pipefail

REPO_ROOT="$(cd "$(dirname "$0")" && pwd)"
OUT="$REPO_ROOT/out"
rm -rf "$OUT"
mkdir -p "$OUT"

resolve_tier() {
  local tier="$1"
  python3 - "$REPO_ROOT" "$tier" <<'PY'
import sys, os, yaml

repo, tier = sys.argv[1], sys.argv[2]
base = yaml.safe_load(open(f"{repo}/feature-base.yml"))["features"]

def load(t):
    p = f"{repo}/feature-overrides/{t}.yml"
    if not os.path.exists(p):
        return None
    return yaml.safe_load(open(p))

def resolve(t):
    cfg = load(t)
    if cfg is None:
        return dict(base)
    parent = cfg.get("inherits", "feature-base")
    state = dict(base) if parent == "feature-base" else resolve(parent)
    for f in cfg.get("enable", []) + cfg.get("enable_extra", []):
        state[f] = 1
    for f in cfg.get("disable", []):
        state[f] = 0
    return state

state = resolve(tier)
for k in sorted(state):
    print(f"{k}={state[k]}")
PY
}

for tier_file in "$REPO_ROOT/feature-overrides/"*.yml; do
  tier="$(basename "$tier_file" .yml)"
  echo "==> Rendering $tier"
  resolve_tier "$tier" > "$OUT/$tier"
done

echo
echo "Rendered tiers:"
ls -la "$OUT"

apply.sh — diffs against live state, prompts, applies:

#!/usr/bin/env bash
# cpanel/apply.sh
# Diff rendered tiers against /var/cpanel/features/<tier> and apply on confirm
set -euo pipefail

REPO_ROOT="$(cd "$(dirname "$0")" && pwd)"
OUT="$REPO_ROOT/out"
LIVE="/var/cpanel/features"
BACKUP="/var/cpanel/features.backup.$(date +%Y%m%d-%H%M%S)"

if [[ ! -d "$OUT" ]]; then
  echo "Run render.sh first."; exit 1
fi

echo "Checking diffs for each tier..."
echo

changed_tiers=()
for f in "$OUT"/*; do
  tier="$(basename "$f")"
  live_file="$LIVE/$tier"
  if [[ ! -f "$live_file" ]]; then
    echo "==> $tier: NEW (does not exist on server)"
    changed_tiers+=("$tier")
    continue
  fi
  if diff -q "$f" "$live_file" >/dev/null; then
    echo "==> $tier: no change"
  else
    echo "==> $tier: CHANGES"
    diff -u "$live_file" "$f" | sed 's/^/    /'
    changed_tiers+=("$tier")
  fi
  echo
done

if [[ "${#changed_tiers[@]}" -eq 0 ]]; then
  echo "Nothing to do."
  exit 0
fi

read -p "Apply changes to ${changed_tiers[*]}? [y/N] " ans
[[ "$ans" =~ ^[Yy]$ ]] || { echo "Aborted."; exit 1; }

echo "==> Backing up live tree to $BACKUP"
cp -a "$LIVE" "$BACKUP"

for tier in "${changed_tiers[@]}"; do
  echo "==> Applying $tier"
  cp "$OUT/$tier" "$LIVE/$tier"
  chmod 644 "$LIVE/$tier"
  chown root:root "$LIVE/$tier"
done

echo
echo "Done. Backup at $BACKUP"
echo "To roll back: rm -rf $LIVE && mv $BACKUP $LIVE"

Usage flow:

cd ops-repo/cpanel
./render.sh
./apply.sh

The first time, apply.sh will show large diffs — that’s the cumulative drift you’ve been carrying. Walk through each change, confirm intent, apply. From that day on, every change to a feature list is a pull request: edit the YAML, re-render, the diff in CI tells reviewers exactly which features are changing for which tier, apply via the script on the WHM server.

Two governance rules that make this work long-term: first, enable_extra (used in platinum.yml) is the only way a tier gets a feature that none of its ancestors have — anything in enable must inherit from a parent’s intent, anything in enable_extra is a tier-specific exception that needs justification in the PR description. Second, when cPanel adds a feature in a major upgrade, it shows up in nothing — feature-base.yml doesn’t list it, the renderer leaves it absent, and on apply the diff shows “feature newshinything removed from silver.” That’s the correct default. If you want the new feature, you add it to feature-base.yml (disabled) and enable it explicitly in the tiers that should have it.

Fleet-wide feature-list governance — versioned in git, diffed before deploy, audited per tier — is part of how we run cPanel hosting under Managed Cloud Ops with package and feature-list audit baked in. Open a scoping call if your tier definitions have drifted past the point of casual cleanup.