Updated: 28 September 2026 · Applies to: cPanel & WHM version 138 on AlmaLinux, Rocky Linux, CloudLinux and Ubuntu servers
cPanel & WHM includes hundreds of command-line scripts in /usr/local/cpanel/scripts/ (the old /scripts path from earlier versions). They are useful when WHM is unreachable, for automation, and for tasks that are faster in a terminal. This page lists the scripts server administrators use most, each checked on a cPanel 138 server and described from cPanel's documentation. Many scripts from old lists online (FrontPage, FreeBSD and Apache 1.3 helpers) no longer exist.
Run these as root, and prefer WHM's own interface for anything you do rarely: scripts do not ask for confirmation.
Updates
/usr/local/cpanel/scripts/upcp: update cPanel & WHM now, according to your update settings.--bgruns it in the background and logs to/var/cpanel/updatelogs/;--forcereinstalls all files, even when up to date.
Restart services
One script per service, named restartsrv_SERVICE:
/usr/local/cpanel/scripts/restartsrv_httpd # Apache /usr/local/cpanel/scripts/restartsrv_nginx # NGINX (ea-nginx) /usr/local/cpanel/scripts/restartsrv_mysql # MySQL or MariaDB /usr/local/cpanel/scripts/restartsrv_exim # mail sending /usr/local/cpanel/scripts/restartsrv_dovecot # IMAP and POP3 /usr/local/cpanel/scripts/restartsrv_pdns # PowerDNS /usr/local/cpanel/scripts/restartsrv_cpsrvd # cPanel and WHM web interfaces
Options include --check (is it running?), --graceful, --reload, --hard, --stop and --start. cPanel's documentation recommends these scripts when a service will not restart from WHM.
Accounts
/usr/local/cpanel/scripts/pkgacct USERNAME /home/backups: pack a full account into acpmove-USERNAME.tar.gzarchive, for backup or migration.--skiphomedirleaves out the home folder./usr/local/cpanel/scripts/restorepkg /home/backups/cpmove-USERNAME.tar.gz: restore an account from such an archive, on this or another cPanel server./usr/local/cpanel/scripts/wwwacct DOMAIN USERNAME PASSWORD: create an account (further options must be given in the documented order; the WHM API functioncreateacctis easier to use in scripts)./usr/local/cpanel/scripts/removeacct USERNAME: terminate an account and delete its data. This cannot be undone; take apkgacctbackup first.
Web server, SSL, DNS and backups
/usr/local/cpanel/scripts/rebuildhttpdconf: rebuild Apache's main configuration from cPanel's data. It does not restart Apache; runrestartsrv_httpdafterwards.--previewwrites a preview file instead./usr/local/cpanel/scripts/ea-nginx clear_cache USERNAME: clear the NGINX cache of one account when NGINX with caching is in use./usr/local/cpanel/bin/autossl_check --user=USERNAME: run an AutoSSL check for one account (or--all), to renew or troubleshoot free certificates./usr/local/cpanel/scripts/cleandns: remove orphaned and duplicate DNS zone entries./usr/local/cpanel/bin/backup: run the configured cPanel backup now.--forcemakes an additional backup even if up-to-date backups exist;--debugruns it in the foreground and shows its progress.
APIs for automation
For scripts of your own, the supported interface is the API, not internal scripts:
whmapi1 listaccts # WHM API 1, as root uapi --user=USERNAME Email list_pops # UAPI, on behalf of one account
Both commands are in /usr/local/cpanel/bin/ and print YAML by default (--output=json for JSON).
Prefer not to run these yourself? Our cPanel server management team handles updates, migrations and troubleshooting.
Official documentation: cPanel scripts documentation.
