This guide will help you learn how to install cPanel and WHM in Google Compute Engine VM Instance. This is the old set up of cPanel, you can view how to install and set up the latest cPanel v76 on Google Cloud.
cPanel is a server management software for website owners which comes with a 15-day trial. Click here to activate cPanel License
Cpanel and WHM can also be installed on other cloud platforms. You can choose any one from below.
Here are some options.
Platform | Machine Type | Cost (Monthly) |
Digitalocean | 4GB RAM – 2vCPU | $20 |
Google Cloud Platform | Standard 3.75 GB RAM | $25 |
Amazon Web Services | A1- Large 4 GB RAM | $35 |
Check how to install cPanel on AWS.
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
In Boot disk click Change and choose CentOS 7. In Size enter, you’re required size
, the minimum should be 40 GB
and click Select
In Firewall check both Allow HTTP traffic
and Allow HTTPS traffic
Click Create
It will take a while before the VM instance will be available for you
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
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 cpanel
Select Resource Record Type to "A"
IPv4 Address with the IP address
of your instance that you have reserved earlier
Leave everything to default.
Click Create
Now your VM instance is configured and ready to setup Firewall rules for cPanel installation.
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 cpanel
In Targets select All instances in the network
In Source filter select IP ranges
In Source IP ranges enter 0.0.0.0/0
In Protocols and ports check TCP and enter 2077, 2078, 2082, 2083, 2086, 2087, 2096, 3306, 53
.
Also, check UDP and enter 53
.
Click Create
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
sudo -s yum update yum install perl yum install wget
Then set the hostname with your domain name. Replace yourdomainname.com
with your domain name
hostname cpanel.yourdomainname.com
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
passwd
Save your password safely, you will need that to login to your WHM
Google Compute Engine won’t preserve the hostname (cpanel.yourdomainname.com) you set and changes it to default hostname, so this may result in a locked cPanel & WHM license. To preserve the hostname follow the below simple steps
cd /etc/dhcp/dhclient-exit-hooks.d/ 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
#!/bin/sh hostname cpanel.yourdomainname.com /scripts/fixetchosts
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 to https://cpanel.yourdomainname.com:2087
Enter username as root
Enter the password you created by running the command passwd
Now you will be logged into your WHM
Agree with Terms and Conditions and go to step 2
Provide your email
address
Server hostname
which we set earlier
In Primary Resolver enter 8.8.8.8
In Secondary Resolver enter 8.8.4.4
Go to Step 3 and again Goto Step 4
Scroll down and Check Configure nameserver A records
Check Add hostname A records
Copy IP Address from Add hostname A records and paste in the above two IPv4
Go to step 5
Enable all notifications
Go to step 6
Click Finish
Goto 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
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 2525
Click Save
As the standard email port is blocked in Google Cloud, you need to configure a third-party email service provider to send emails. Here we can use Mailgun to configure emails in cPanel.
Make sure you have these DNS records.
A
record pointing to mail.domain.com
MX
record with 0 priority pointing to mail.domain.com
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
mailgun_login: driver = plaintext public_name = LOGIN hide client_send = : Default SMTP Login : Default Password
In the Section: PREROUTERS box enter
mailgun: driver = manualroute domains = ! +local_domains transport = mailgun_transport route_list = * smtp.mailgun.org::2525 byname
In the Section: TRANSPORTSTART box enter
mailgun_transport: driver=smtp hosts_try_auth = smtp.mailgun.org
cPanel is a subscription-based software, you can activate your license within your 15 days trial period.
Save the configurations, that’s everything about cPanel & WHM on Google Cloud.
27554 Comments
Hello there! Do you know if they make any plugins to safeguard
against hackers? I’m kinda paranoid about losing everything
I’ve worked hard on. Any recommendations?
Also visit my homepage: double glazing window
Amazing! This blog looks just like my old one! It’s on a entirely different topic but it has pretty much the same layout and design. Superb choice
of colors!
I think the admin of this web site is really working hard in support of his website,
because here every material is quality based stuff.
Review my web-site … bosch washing machines model waj28008gb
I was able bean to cup coffee machine reviews find good advice from your blog articles.
Magnificent items from you, man. I’ve understand your stuff prior to and you’re simply
extremely great. I actually like what you’ve received right here, really like what you’re stating and the
way in which you are saying it. You make it
entertaining and you still care for to stay it smart.
I can not wait to read far more from you. That is really a terrific website.
I used to be recommended this blog via my cousin. I’m not sure whether this
publish is written by means of him as nobody else realize such particular approximately my trouble.
You’re amazing! Thanks!
Way cool! Some very valid points! I appreciate you writing this article and also the rest of the site is very good.
Also visit my website: best bean to cup coffee machine
Hello! I could have sworn I’ve been to this site before but after checking through some of
the post I realized it’s new to me. Anyways, I’m definitely
delighted I found it and I’ll be bookmarking and checking back often!
My web page: windoe
Simply want to say your article is as astonishing.
The clearness in your post is simply cool and i can assume
you are an expert on this subject. Fine with your permission allow window fitters near me
to grab your feed to keep updated with forthcoming post. Thanks a million and please keep up the enjoyable work.
It’s really a great and helpful piece of info. I’m happy that you shared this useful
info with us. Please keep us up to date like this. Thanks for sharing.
Very nice post. I simply stumbled upon your weblog
and wished to say that I’ve truly enjoyed surfing around your blog posts.
In any case I will be subscribing on your feed and I’m
hoping you write again soon!
Here is my website; windowa
Wow, awesоme blog layout! Hοw long have you been blogging for?
you made blogging ⅼook easy. The overall look of your websitre is magnificent, as well aѕ the content!
I simply couldn’t depart your site before suggesting that I really
enjoyed the usual info a person provide for your guests?
Is going to be back frequently to investigate
cross-check new posts
my web page 成人影片
I savour, cause I discovered just what I was taking a look for.
You’ve ended my 4 day long hunt! God Bless you man. Have a great
day. Bye