Emergency server help: get in touch

cPanel /scripts Commands: upcp, Licence Refresh, Package Repair and Service Restarts (cPanel 138)

The cPanel & WHM command-line scripts admins actually use, checked on cPanel 138: version and licence, upcp (--force, --sync, --security), package repair, service restarts, account scripts, which old scripts are gone, and which ones ignore --help.

Published Updated 6 min read

These are the cPanel scripts (in /scripts and /usr/local/cpanel) that server admins use most, each run and checked on cPanel & WHM 138.

Applies to cPanel & WHM 138.0 build 15 (RELEASE tier); AlmaLinux 9.8; MariaDB 10.11; lab test 11 Oct 2026

Short answer:

  • Version: /usr/local/cpanel/cpanel -V.
  • Refresh the licence: /usr/local/cpanel/cpkeyclt.
  • Update: /usr/local/cpanel/scripts/upcp. Add --force to reinstall the current version, or --sync to repair without upgrading.
  • Check and repair cPanel’s own packages: scripts/check_cpanel_pkgs --list-only, then --fix.
  • Restart a service the cPanel way: scripts/restartsrv_SERVICE.

/scripts is a link to /usr/local/cpanel/scripts, so /scripts/upcp also works.

We checked every script on this page on our cPanel lab server (cPanel & WHM 138.0 build 15, RELEASE tier, AlmaLinux 9.8) on 11 October 2026. We confirmed each one exists, read its --help, and ran the read-only and safe ones: the version, cpkeyclt, check_cpanel_pkgs --list-only, restartsrv_exim --status, whoowns and check_unreliable_resolvers. We did not run upcp --force, --fix or the account scripts, because they change the server.

Careful: some scripts ignore --help and just run

Before you type --help after an unfamiliar cPanel script, know that several of them do not understand it and simply do their job. On our cPanel 138 lab:

  • cleanupmysqlprivs started removing MySQL privileges (UPDATE user SET Create_priv='N' ...). On MariaDB 10.4 and later mysql.user is a view, so it stopped at the first statement with ERROR 1356 and changed nothing. On an old MySQL it would have changed users’ rights. Do not run it on a modern server.
  • updateuserdomains and fix-cpanel-perl ran without printing anything.
  • autorepair tried to download a repair named --help from cPanel and failed.

Read the script first (less /usr/local/cpanel/scripts/NAME) or check cPanel’s documentation before running anything you do not know.

Version and licence

/usr/local/cpanel/cpanel -V          # 138.0 (build 15)
/usr/local/cpanel/cpkeyclt           # Updating cPanel license...Done. Update succeeded.
ls -l /usr/local/cpanel/cpanel.lisc  # the licence file cpkeyclt refreshes

cpkeyclt asks cPanel’s licence server again, which fixes most “licence invalid” messages after an IP change or a renewal. If it fails, see “cPanel license is invalid”: troubleshooting.

Update cPanel: upcp

/usr/local/cpanel/scripts/upcp              # update according to /etc/cpupdate.conf
/usr/local/cpanel/scripts/upcp --force      # reinstall even if up to date
/usr/local/cpanel/scripts/upcp --sync       # repair the installed version, no upgrade (not with --force)
/usr/local/cpanel/scripts/upcp --bg         # run in the background; output only in the log
/usr/local/cpanel/scripts/upcp --security   # only expedited security updates (also runs hourly from cron)

These options come from upcp --help on cPanel 138. --security is new: it applies a security release for your current major version, and packages that cPanel has flagged as security fixes. It follows SECURITY_UPDATES and RPMUP in /etc/cpupdate.conf and does nothing when there is nothing to apply. --cron makes a run follow WHM’s Update Preferences. The settings file on our lab:

CPANEL=release
RPMUP=daily
SARULESUP=daily
SECURITY_UPDATES=hourly
STAGING_DIR=/usr/local/cpanel
UPDATES=daily

Logs are in /var/cpanel/updatelogs/. Choosing a tier: LTS 134, RELEASE 138 or STABLE. When upcp fails: upcp failed: upgrade blocked.

Check and repair cPanel’s packages

/usr/local/cpanel/scripts/check_cpanel_pkgs --list-only     # list altered or missing cPanel packages
/usr/local/cpanel/scripts/check_cpanel_pkgs --long-list     # the same, with the altered files
/usr/local/cpanel/scripts/check_cpanel_pkgs --fix           # reinstall the affected packages

It checks cPanel-managed packages for changed ownership, MD5 mismatches, wrong symlinks and packages that should or should not be installed. On our lab, --list-only took 17 seconds, printed nothing and exited 0, which means everything was intact. --targets limits the check to some packages, and --no-digest speeds it up by skipping the checksum check.

Restart services: restartsrv_*

/usr/local/cpanel/scripts/restartsrv_httpd             # soft restart (default)
/usr/local/cpanel/scripts/restartsrv_httpd --graceful
/usr/local/cpanel/scripts/restartsrv_httpd --hard      # skip the soft restart
/usr/local/cpanel/scripts/restartsrv_exim --status     # is it running? (also the exit code)
/usr/local/cpanel/scripts/restartsrv_dovecot --stop

cPanel 138 on our lab has 46 restartsrv_ scripts, including apache_php_fpm, cpsrvd, cphulkd, dovecot, exim, ftpd, httpd, mysql, named, pdns and postgresql. List them with ls /usr/local/cpanel/scripts/restartsrv_*. Prefer these over systemctl restart on cPanel servers: they use cPanel’s own service handling and support the soft and graceful restarts shown above.

Accounts and ownership

ScriptWhat it doesNote
whoowns DOMAINPrints the cPanel user that owns a domainRan it: site1
pkgacct USER / restorepkg FILEBack up / restore one accountSee pkgacct and restorepkg
wwwacct DOMAIN USER PASS ...Create an accountPrefer whmapi1 createacct; wwwacct takes positional arguments
removeacct USERTerminate an accountkillacct does not exist on cPanel 138
updateuserdomainsRebuild the user/domain mapsRuns straight away, no prompt
modify_accountsChange accounts’ theme or styleRead its --help
fixquotasRecalculate disk quotasSee fixquotas repair
mailpermFix mail file permissions
rebuildhttpdconfRebuild the Apache configurationThen restartsrv_httpd
cpbackupRun the configured cPanel backup now

Other useful cPanel scripts and server roles

ScriptWhat it does
setupmailserver, setupftpserver, setupnameserverSwitch the mail, FTP or DNS server software
check_unreliable_resolversTests the resolvers in /etc/resolv.conf (our lab: OK)
update_local_rpm_versionsChanges which package versions cPanel installs (advanced)
rebuild_whm_chromeRebuilds the WHM interface frame after plugin changes
convert_roundcube_mysql2sqliteMoves Roundcube’s storage from MySQL to SQLite

Scripts that are gone

Old guides still mention scripts that do not exist on cPanel 138. On our lab these were missing:

  • killacct (use removeacct)
  • rebuild_dns_config
  • setupmysqlserver
  • checkallsslcerts (it moved to /usr/local/cpanel/bin/checkallsslcerts)
  • fixmailboxperms (use mailperm)
  • migrate_ea3_to_ea4 and makecpphp (EasyApache 3 is long gone)
  • install_lets_encrypt_autossl_provider and rebuild_mailman_config

Before you rely on a script from an old guide, check that it exists: ls /usr/local/cpanel/scripts/NAME.

Vendor reference: the cPanel & WHM documentation.

At a glance

cPanel Scripts Guide: upcp, cpkeyclt and check_cpanel_pkgs – summary card
In short: cPanel scripts checked on cPanel 138: upcp (--force, --sync), cpkeyclt licence refresh, check_cpanel_pkgs, restartsrv_* and scripts that are gone.

Frequently asked questions

How do I force a cPanel update?

Run /usr/local/cpanel/scripts/upcp --force as root. It reinstalls cPanel even if it is up to date. To repair the installed version without upgrading, use upcp --sync instead (the two cannot be combined).

How do I refresh the cPanel licence from the command line?

Run /usr/local/cpanel/cpkeyclt as root. It prints Update succeeded when the licence server confirms the licence for the server’s IP.

What does upcp --security do?

On cPanel 138 it applies expedited security updates only: a security release for the current major version and packages cPanel flagged as security fixes. It runs hourly from cron and follows SECURITY_UPDATES and RPMUP in /etc/cpupdate.conf.

How do I check whether cPanel files were changed?

Run /usr/local/cpanel/scripts/check_cpanel_pkgs --list-only. It lists cPanel packages with changed files, ownership or symlinks. No output and exit code 0 means everything is intact; --fix reinstalls the affected packages.

Is it safe to run a cPanel script with --help?

Not always. On cPanel 138, cleanupmysqlprivs, updateuserdomains, fix-cpanel-perl and autorepair ignore --help and start working. Read the script or the documentation first.

Reading a lot of our guides? Go ad-free with srvScripts Pro for $6 a month. It also pays for new guides. Cancel any time.

Share this guide

Free website test

Is your website set up right?

Check SSL, security headers, redirects, robots.txt, sitemap, llms.txt and security.txt in one test. It takes about 30 seconds.