How to terminate a cPanel account in WHM safely
Remove a cPanel account from WHM without regrets. Take a full backup first, decide whether to keep the DNS zone, terminate one or many accounts and confirm files and databases are gone.
- Beginner
- Linux VPS
- 3 min read
Terminating a cPanel account deletes everything it owns: website files, mailboxes, databases, cron jobs and usually its DNS zone. It cannot be undone from WHM. This guide shows how to take a backup first, terminate one or several accounts, and confirm that the data has really gone.
Before you start
- Root or reseller access to WHM on a cPanel server running on a RunRacks Linux VPS.
- Written confirmation from the account owner or your own records that the account should be removed.
- Enough free disk space for one full backup of the account.
Termination permanently deletes the account's files, email and databases. There is no recycle bin. Take a backup and copy it off the server before you continue.
Consider suspending first
If you are not sure the account is finished with, suspend it instead. A suspended account keeps all its data but stops serving the site. If nobody complains within a few weeks, terminate it then. See suspend and unsuspend cPanel accounts.
Step 1: Take a full backup
Create a full account backup (a cpmove file) from SSH:
/scripts/pkgacct exampleuser /root/final-backupsReplace exampleuser with the cPanel username. Create the folder first with mkdir -p /root/final-backups. When it finishes, you will see a file like:
/root/final-backups/cpmove-exampleuser.tar.gzCopy it off the server, for example to your computer:
scp [email protected]:/root/final-backups/cpmove-exampleuser.tar.gz .This file can be restored later with WHM's Restore a Full Backup/cpmove File tool if needed.
Step 2: Terminate one account
- In WHM, go to Home » Account Functions » Terminate Accounts.
- Find the account by domain or username and select it.
- Decide about DNS:
- Leave Keep DNS Zone unticked to remove the zone. Choose this when the domain is gone for good or moving to another provider that will host its own DNS.
- Tick Keep DNS Zone if this server is still the authoritative nameserver and you want the domain to keep resolving, for example while it moves elsewhere.
- Click Terminate, then confirm.
WHM shows a log while it removes the account.
Terminate several accounts
The same page lets you select several accounts at once. Select each one, check the list carefully, then click Terminate and confirm.
Bulk termination is the fastest way to delete the wrong account. Read the list of usernames twice before you confirm, and make sure each has a backup.
Check it works
Confirm the account is gone:
grep exampleuser /etc/trueuserdomains
ls -ld /home/exampleuserBoth should return nothing, or an error saying the directory does not exist.
Check its databases are gone. The name prefix is the username:
mysql -e "SHOW DATABASES LIKE 'exampleuser\_%';"The query should return no rows.
If you removed the DNS zone:
ls /var/named/example.com.dbIt should not exist.
Troubleshooting
- Account still listed after terminating: the process failed part way. Check the output on screen, then run the termination again.
- Domain still resolves to this server: the zone was kept, or other servers still cache the old records. Remove the zone or wait for the TTL to expire.
- Leftover databases or users: a database was created outside cPanel with a name that does not use the account prefix. Remove it manually after checking it is not in use.
- Need the account back: restore the
cpmovefile in Home » Backup » Restore a Full Backup/cpmove File.
Next steps
- Learn restore options: restore a cPanel account backup.
- Keep regular backups: cPanel backup configuration.
- Need help with your server? Open a ticket.
Was this guide helpful?
Still stuck?
Ask RunRacks AI for a quick answer, or open a ticket and our team will take a look at your server.
Related guides
Control panels
How to install Plesk on a Linux VPS (AlmaLinux and Ubuntu)
Install Plesk on a fresh Linux VPS with the official one-click installer, apply your licence key and log in to the panel for the first time on port 8443.
- Beginner
- Linux VPS
- 8 min read
Control panels
CyberPanel: back up and restore a website
Create on-demand and scheduled website backups in CyberPanel, download the archives off the server, and restore a site from a backup when something breaks.
- Intermediate
- Linux VPS
- 6 min read
Control panels
Plesk Backup Manager: schedule backups and restore a site
Set up scheduled backups in Plesk Backup Manager, keep a copy off the server, and restore a single domain or subscription when something goes wrong.
- Intermediate
- Linux VPS
- 7 min read