cPanel does not provide an official uninstaller. If a cPanel installation fails, the usual recommendation is to reinstall the entire server.
However, it is possible to clean the existing installation and reinstall cPanel without formatting the server.
This guide explains how to remove the broken installation and perform a fresh install.
This process removes cPanel, MySQL/MariaDB, and all related data. Only use it on servers where data loss is acceptable or backups exist.
systemctl stop mariadb
apt purge mariadb* mysql* -y
apt purge 'cpanel*' -y
apt autoremove -yFirst remove file attributes that may block deletion:
chattr -R -a /usr/local/cpanel/logsThen delete all cPanel-related directories:
rm -rf /usr/local/cpanel
rm -rf /var/cpanel
rm -rf /etc/cpanel
rm -rf /var/lib/cpanel
rm -rf /var/log/cpanel*
rm -rf /var/lib/mysql
rm -rf /etc/mysql
rm -rf /root/.my.cnfClean and repair any broken packages before reinstalling:
apt --fix-broken install -y
dpkg --configure -a
rebootDownload and run the official installer:
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest