When installing cPanel to your new server, a check is performed to see if an FQDN (fully-qualified domain name) is set up as the hostname. If this hostname is not valid, the installation will fail at that point.
Your hostname (mycpanel.hostname) is invalid, and must be set to a fully qualified domain name before installing cPanel. A fully qualified domain name must contain two dots, and consists of two parts: the hostname and the domain name. You can update your hostname by running `hostname your-hostname.example.com`, then re-running the installer. ********************* ERROR ********************* Exiting...
You can update the hostname through a couple of different methods through the command line, but the following directions are to use ‘hostnamectl,’ which is available for the majority of the OSes cPanel Supports.
Procedure
You can verify your current hostname by running the hostname command:
~# hostname mycpanel.hostname
Step 1: Use set-hostname to Change the Hostname
Type the following command:
hostnamectl set-hostname new-hostname
Be sure to use your own hostname choice instead of new-hostname
*Make sure the new hostname the requirements for an FQDN.
Effective Hostname Usage With cPanel & WHM
Step 2: Use hostnamectl to Confirm the Change
When the command is successful, ‘hostnamectl set-hostname does not produce any output.
Therefore, use ‘hostnamectl’ to check the result.
~# hostnamectl Static hostname: server.mycpanel.net Icon name: computer-vm Chassis: vm Machine ID: 25e1cd57343e45ba9385a719b7233809 Boot ID: f671cce601254c1f83d61a0007ed8cb6 Virtualization: kvm Operating System: Ubuntu 20.04.2 LTS Kernel: Linux 5.4.0-77-generic Architecture: x86-64