Updated: 29 September 2026 · Applies to: cPanel & WHM 138 on AlmaLinux, Rocky Linux and CloudLinux 8, 9 and 10, and Ubuntu 24.04 (checked on an AlmaLinux 9 server)

A quick reference of the command-line tools a cPanel server administrator uses for everyday jobs: accounts, services, updates, email, databases, DNS and backups. Run them as root over SSH. We checked that every script below exists on a cPanel & WHM 138 server. For files, logs and lookups (which account owns a domain, where to find a log), see top cPanel commands and files every server admin should know; for the maintenance scripts in more depth, see useful cPanel and WHM command-line scripts.

1. Accounts

whmapi1 listaccts                                           # all accounts
whmapi1 createacct username=myuser domain=example.com plan=default
/usr/local/cpanel/scripts/suspendacct myuser "Unpaid invoice"
/usr/local/cpanel/scripts/unsuspendacct myuser
/usr/local/cpanel/scripts/removeacct myuser                 # asks for confirmation

Without a password= parameter, createacct generates a secure password; set your own later in WHM under Password Modification, so it does not end up in the shell history. Removing an account deletes its files, mail and databases, so take a backup first (section 7).

2. Services

/usr/local/cpanel/scripts/restartsrv_httpd       # Apache
/usr/local/cpanel/scripts/restartsrv_exim        # Exim mail server
/usr/local/cpanel/scripts/restartsrv_cpsrvd      # cPanel and WHM web service
/usr/local/cpanel/scripts/restartsrv_httpd --status; echo $?   # 0 means running
systemctl status cpanel                          # cPanel's own services

For services that cPanel manages, use these restartsrv_ scripts or WHM's Service Manager, as cPanel recommends, rather than restarting them by other means.

3. Updates

/usr/local/cpanel/cpanel -V                       # installed version
/usr/local/cpanel/scripts/upcp                    # update cPanel & WHM now
dnf check-update                                  # pending operating system updates
dnf upgrade                                       # install them (apt update && apt upgrade on Ubuntu)

Update logs are in /var/cpanel/updatelogs/.

4. Email

uapi --user=myuser Email list_pops                          # mailboxes of an account
uapi --user=myuser Email delete_pop email=info@example.com  # delete a mailbox
exim -bpc                                                   # number of queued messages
exim -qff                                                   # retry delivery of the whole queue

5. Databases

mysql -e "SHOW DATABASES;"
uapi --user=myuser Mysql create_database name=myuser_shop   # names start with the account prefix
mysqldump --single-transaction myuser_shop > /root/myuser_shop.sql

6. DNS

whmapi1 listzones
whmapi1 addzonerecord domain=example.com name=shop.example.com. class=IN ttl=14400 type=A address=203.0.113.10
/usr/local/cpanel/scripts/updateuserdomains        # rebuild the domain-to-account lists

End full host names with a dot, as in shop.example.com., so the name is not treated as relative to the zone.

7. Backups

/usr/local/cpanel/scripts/pkgacct myuser /home/backups     # full account backup to a folder
/usr/local/cpanel/scripts/restorepkg /home/backups/cpmove-myuser.tar.gz

For scheduled backups, use WHM's Backup Configuration instead of your own scripts.

Always try unfamiliar commands on a test account first. If you would rather have a team run the server, see our cPanel server management.

Official documentation: cPanel & WHM documentation and cPanel API reference.

Ucartz services for this topic

Was this answer helpful? 8923 Users Found This Useful (8935 Votes)