How to Install cPanel v76 on Google Cloud with CentOS 7 and set up Email and Security using Web Host Manager (WHM). This version simplifies the WHM setup in just two clicks compared to the installation of old cPanel version.
This guide will help you learn how to install cPanel v76 on Google Compute Engine VM Instance.
cPanel is a server management software for website owners which comes with a 15-day trial. Then you need to subscribe for using cPanel
Steps to install cPanel and WHM
- Create the VM Instance
- Verify cPanel & WHM license history and validity
- Setup Cloud DNS
- Setup Firewall rules
- Install cPanel
- Set up Hostname on Google Cloud
- Agree to Terms and Conditions
- Setup Email in WHM
Create the VM Instance
Go to Compute Engine >> VM Instances and click Create Instance
In Name provide a
name for your Instance
In Region choose the region closest to your visitors
In Machine Type choose
3.75 GB memory 1vCPU
40 GB and click Select
In Firewall check both
Allow HTTP traffic and
Allow HTTPS traffic
It will take a while before the VM instance will be available for you
Verify cPanel & WHM license history and validity
Once your VM instance is created you will be provided with an external IP address which is used to license your cPanel. So you need to verify if the IP address has a valid 15-day trial license. So visit verify cPanel license and enter your external IP address and click Verify License. If the IP address does not have a valid license you can restart your VM instance. Then a new IP will be assigned. Then you can check again.
Reserve your IP address
If your IP address has a valid license you can proceed to reserve your IP address by going to VPC Networks >> External IP Addresses reserve your IP address to Static.
Setup Cloud DNS
Please follow this guide to setup Cloud DNS and point your domain to Google Cloud.
Once you have created DNS Zone, you need to create one additional A record for cpanel subdomain in your Cloud DNS.
Click Add record set
In Name enter
Select Resource Record Type to
IPv4 Address with the
IP address of your instance that you have reserved earlier.
Leave everything to default.
Now your VM instance is configured and ready to setup Firewall rules for cPanel installation.
Setup Firewall rules
cPanel & WHM uses some ports to manage the server, so you need to create a firewall to provide access to these ports.
Go to VPC Network >> Firewall rules and click Create Firewall rules.
In Name enter
In Targets select
All instances in the network
In Source filter select
In Source IP ranges enter
In Protocols and ports check TCP and enter
2077, 2078, 2082, 2083, 2086, 2087, 3306, 53. Also check UDP and enter
Go to Compute Engine >> VM Instances and click the SSH button right next to your instance to open the terminal window in the browser.
Once the terminal is opened enter the following commands one by one.
yum install perl
yum install wget
Then set the hostname with your domain name. Replace
yourdomainname.com with your domain name.
Now stop firewall and disable Network manager.
systemctl stop firewalld
systemctl stop NetworkManager
systemctl disable NetworkManager
Download latest cPanel and install it by running the following command.
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest
It will take around 30 – 40 min to complete the install. Don’t close the terminal until the setup is completed.
Once the setup is completed, you can set the root password by executing the following command.
Save your password safely, you will need that to login to your WHM.
Set up Hostname in Google Cloud
Google Compute Engine won’t preserve the hostname (
cpanel.yourdomainname.com) you set and changes it to default hostname automatically, so this may result in a locked cPanel & WHM license. To preserve the hostname follow the below simple
sudo nano set-hostname.sh
Paste the following contents and hit
Ctrl+X followed by
Y to save the filter. Remember to replace
yourdomainname.com with your domain name
Set correct permissions to the file you created
chmod 744 set-hostname.sh
That’s all now your cPanel is installed and ready to finish the WHM setup
Open your browser and navigate
https://IP_ADDRESS:2087). It will take some time for the SSL certificate to get issued by cPanel.
Enter username as
Enter the password you created by running the command passwd
Now you will be logged into your WHM.
Click Agree to All.
Now you will be taken to the WHM home page.
Setup Email in WHM
In Google Cloud Platform port 25, which cPanel & WHM utilizes for SMTP, is not open. So you need to create an account with Mailgun or Sendgrid and integrate with WHM for emails.
Google provides additional documentation for sending email from Compute Engine Instances here.
Allow SMTP on Port 2525
Go to Service Configuration >> Service Manager
Tick both boxes next to Exim Mail Server (on another port)
Change Allow exim to listen on a port other than 25 to
Prevent sending mail & Disable Horde and Squirrel
Go to Server Configuration >> Tweak Settings.
Prevent “nobody” from sending mail =
Enable Horde Webmail =
Enable Mailman mailing lists =
Enable Roundcube webmail =
Go to Service Configuration >> Exim Configuration Manager.
Click Advanced Editor tab.
In CONFIG section, under domainlist local_domains enter
lsearch;/etc/localdomains : localhost : cpanel.yourdomainname.com : [GOOGLE INSTANCE NAME] : @
In daemon_smtp_ports enter
465 : 25 : 587 : 2525
In the Section: AUTH box enter.
driver = plaintext
public_name = LOGIN
hide client_send = : Default SMTP Login : Default Password
In the Section: PREROUTERS box enter.
driver = manualroute
domains = ! +local_domains
transport = mailgun_transport
route_list = * smtp.mailgun.org::2525 byname
In the Section: TRANSPORTSTART box enter.
hosts_try_auth = smtp.mailgun.org
Save the configurations, that’s everything about cPanel & WHM on Google Cloud.