How to Install cPanel & WHM on Google Compute Engine™ Through The Google Marketplace
Last modified: July 14, 2021
This document explains how to install a cPanel & WHM instance on the Google Compute Engine™ service through the Google Marketplace.
To activate a new license, you must have a cPanel Store account with a verified email address.
Due to networking requirements, you cannot run an IPv6-only cPanel & WHM server. You must have at least one IPv4 address.
Create a cPanel & WHM instance on Google Compute Engine
Access the Google Compute Engine.
To log in to the Google Compute Engine website, perform the following steps:
If you do not already possess a Google account, create one. Then, log in to Google.
Navigate to the Google Compute Engine website. The Google Compute Engine interface will appear.
Click Get Started For Free. A new interface will appear.
Accept the trial offer.
Accept the Terms of Service and click CONTINUE. The Payment Information interface will appear.
Enter or confirm your payment information.
To enter or confirm your payment information, perform the following steps:
Enter your payment information or confirm the existing payment method on your account.
Click START MY FREE TRIAL. The Google Cloud Platform interface will appear, and Google will send you a confirmation email. Provide the information the interface asks for.
Use the cPanel & WHM Marketplace image
To use the cPanel & WHM image on Marketplace, perform the following steps:
Click the three-line menu button in the upper left of the screen, then click Marketplace. The Marketplace interface will appear.
Search for cPanel. A list of images will appear.
Click the cPanel & WHM on Linux image. The full image profile will appear.
Read the details, such as estimated costs.
Click the LAUNCH button.
A list of required APIs will appear. Click ENABLE to enable these required APIs. The New cPanel & WHM on Linux deployment interface will appear.
Create an instance.
To create the instance, perform the following steps:
In the Deployment name text box, enter a name for the instance.Note:The Deployment name can only contain lowercase characters, numbers or dashes. It must start with a lowercase letter and cannot end with a dash.
In the Zone menu, select a zone within the region.
In the Machine type section, select the Series and Machine type for your instance.Note:You must select a Machine type with at least 1GB of memory. However, we recommend using at least 2GB of memory.
In the Boot disk section, click Change. A new section will appear.
Under Boot disk type, select Standard persistent disk .
Set the Boot disk size in GB text box to more than 40GB.
In the Networking section, click Add network interface and select a network if you do not wish to use the default network.Note:
For information about how to create an instance with multiple network interfaces, read Google’s Creating instances with multiple network interfaces documentation.
In the Firewall section, we have already configured the required ports for your instance.
After the Firewall section, select I accept the GCP Marketplace Terms of Service and cPanel, L.L.C. Terms of Service.
Click Deploy. Google Cloud Platform’s Deployment Manager interface will appear.
Connect to the instance.
The interface will display a green icon next to the instance name when it is ready.
The right panel contains helpful information to get you logged in to your server. To connect to the instance, perform the following steps:
Click SSH. A new window will appear with a terminal session.
sudo su -to get
Change the root password.
To change the
root user’s password, perform the following steps:
Enter a new password.
Enter the new password again.
A confirmation message will appear.
Assign a hostname to the server.
To assign a hostname to the server, run the following command, where
hostname.example.com represents your desired hostname:
hostnamectl set-hostname hostname.example.com
Create the hostname fix hook.
To configure VPS deployments, many cloud hosting providers use the
dhclient script. This script includes the configuration of the instance’s hostname. But, the
dhclient script may not preserve the locally-configured hostname. So, hosting providers use scripts to work around this issue. For example, Google Cloud Platform Services™ uses the
The workaround scripts may interfere with WHM’s Change Hostname feature (WHM >> Home >> Networking Setup >> Change Hostname). These can cause hostname configuration issues and a locked cPanel & WHM license. You must create a
dhclient exit hook script to set the hostname properly.
To create the hook, run the following command, where
hostname.example.com represents your server’s hostname:
mkdir -p /etc/dhcp/dhclient-exit-hooks.d/ && echo -ne '#!/bin/sh\nhostname hostname.example.com\n/scripts/fixetchosts\n' > /etc/dhcp/dhclient-exit-hooks.d/zzz-set-hostname.sh && chmod +x /etc/dhcp/dhclient-exit-hooks.d/zzz-set-hostname.sh
For information on this hook, read our Cloud-Hosted Hostname Solution documentation.
When you finish, close the terminal session and return to the Google Compute Engine interface.
Configure a static IP address.
By default, Google assigns ephemeral IP addresses to VM instances. They will remain assigned to the server as long as the VM is active, but will change if you turn off and then turn back on a VM.
To configure a static IP address for the server, perform the following steps:
Click the three-line menu button on the left side of the screen. Under Networking, select VPC network. Then, select External IP addresses.
You will see all external IP addresses your instances use. Locate the ephemeral IP address you want to convert.
Under Type, click the arrow next to Ephemeral.
Select Static. A new window will appear.
In the Name text box, enter a name for the IP address.
Log in to WHM.
To log in to WHM, perform the following steps:
Navigate to the following URL, where
IPADDRESSrepresents your server’s external IP address:
https://IPADDRESS:2087Note:You can also return to the Deployment Manager interface and click the Admin URL link.
Enter your username and password.
Click Log in.
For more information about how to configure cPanel & WHM, read our WebHost Manager documentation.
For more information on how to quickly build a website on a newly-installed cPanel & WHM server, read our From WHM to Website documentation.
Google blocks port
By default, Google disables port
25 for outbound email traffic.
For more information on Google’s block of port
25, read Google’s Sending Email from an Instance documentation.
For potential solutions, read Google’s SMTP relay: Route outgoing non-Gmail messages through Google support article and the Smarthost configuration section on our Exim Configuration Manager documentation.
Deleting an instance
To delete a Google Compute instance, read Google’s Deleting an Instance documentation.