Launch a cPanel and WHM instance

on Amazon Lightsail

Amazon Lightsail is the easiest way to get started with AWS. It offers virtual servers, storage, databases and networking, plus a cost-effective, monthly plan.

This tutorial walks through a few steps that you can take after your cPanel and WHM instance is up and running on Amazon Lightsail. 

When you're done with this tutorial, you will have the fundamentals to get your WordPress website up and running in Amazon Lightsail.

Get started with Lightsail for free.

Note: Your cPanel & WHM instance includes a 15-day trial license. After 15 days, you must purchase a license from cPanel to continue using cPanel & WHM. If you plan on purchasing a license, complete steps 1-6 of this guide before purchasing your license.

About this Tutorial
Time 10-20 minutes      
Cost Free
Use Case Compute
Products Amazon Lightsail
Level 200
Last Updated July 27, 2020

Already have an account? Log in to your account

Step 1: Change the root user password

Complete the following procedure to change the root user password on your cPanel instance. You will use the root user and password to sign in to the Web Host Manager (WHM) console later.

1.1 — On your instance management page, under the Connect tab, choose Connect using SSH.

1.2 — After you're connected, enter the following command to change the password for the root user:

sudo passwd

1.3 — Enter a strong password and confirm it by entering it a second time.

Remember this password because you will use it to sign in to the WHM console later in the tutorial.

Step 2: Attach a static IP address to your cPanel & WHM instance

Important

The default dynamic public IP address attached to your instance changes every time you stop and start the instance. Create a static IP address, and attach it to your instance, to keep the public IP address from changing. Later, when you use your domain name with your instance, you don’t have to update your domain’s DNS records each time you stop and start the instance. Or if your instance fails, you can restore your instance from a backup and reassign your static IP to your new instance.

You must specify the public IP address of your cPanel & WHM instance when purchasing a license from cPanel. The license that you purchase is associated to the IP address of your instance. Because of this, you must attach a static IP to your cPanel & WHM instance if you plan on purchasing a license from cPanel. Specify your static IP when you purchase a license from cPanel, and keep your static IP for as long as you plan to use your cPanel & WHM license with a Lightsail instance. If you need to
transfer your license to another IP address later, you can submit a request to cPanel. For more information, see Transfer a license in the WHM documentation.

2.1 — On your instance management page, under the Networking tab, choose Create static IP, then follow the instructions on the page.

Step 3: Sign in to the Web Host Manager for the first time

Complete the following procedure to sign in to the WHM console for the first time.

3.1 —Open a web browser and navigate to the following web address. Replace <StaticIP> with the static IP address of your instance. Be sure to add :2087 to the end of the address, which is the port on which you will establish a connection to your instance.

Important: you must include https:// in your browser's address bar when navigating to the IP address and port of your instance. Otherwise, you will get an error stating that the site can't be reached.

If you're unable to establish a connection when browsing to the static IP address of your instance over port 2087, check that your router, VPN, or internet service provider allows HTTP/HTTPS connections through port 2087. If it does not, then try to connect using a different network.

You might also see a browser warning that your connection is not private, not secure, or that there’s a security risk. This happens because your cPanel instance does not yet have an SSL/TLS certificate applied to it. In the browser window, choose Advanced Details, or More information to view the options that are available. Then choose to proceed to the website even if it’s not private or secure.

https://<StaticIP>:2087

Example:

https://192.0.2.0:2087

3.2 — Enter root in the Username text box, and entire the root user password in the Password text box. 

This is the password that you specified earlier in the Step 1: Change the root userpassword section of this tutorial. 

Choose Log in. 

3.3 — Choose Agree to all if you would like to proceed.

3.4 — Choose Skip in the email address and name servers page. You can configure these later.

3.5 — Choose whether you want to enable new features for WHM. Choose Save Settings or Exit to WHM to continue.


The WHM console appears, where you can manage the settings and features for cPanel.

Note: If you chose to save settings and enable new features for WHM, then you might be required to reboot your instance for those updates to take effect. To reboot your instancem choose the You must reboot the server to apply software updates link in the top navigation bar of the WHM console and follow the prompts to reboot. 

Select instance types to use

Step 4: Change the hostname and IP address of your cPanel & WHM instance

Complete the following steps to change the hostname of your instance, so that you don't have to use its public IP address to access the WHM console..

4.1 — Choose the navigation menu icon in the top-left section of the WHM console.

Enter Change hostname in the search text box in the WHM console, then choose the Change hostname option in the results.

4.2 — Enter the hostname that you want to use to access the WHM console in the New hostname text box. For example, enter management.example.com or administration.example.com.

Note: You can only specify a subdomain as the hostname, and you cannot specify whm or cpanel as the subdomain.

Then, choose Change. 
 

4.3 — Choose the navigation menu icon in the top-left section of the WHM console. Then, choose Basic WebHost Manager Setup

4.4 — Under the All tab, scroll down and find the Basic Config section of the page. In the IPv4 address text box, enter the new static IP address of the instance. 

4.5 — Scroll to the bottom of the page and choose Save Changes. 

Note: If you receive an Invalid License file error message, wait and try to change the IP address again after a few minutes. 

The hostname and IP address of your instance are now changed, but you must still map your domainname to your cPanel & WHM instance. You do this by adding an address (A) record in the domainname system (DNS) of your registered domain name. The A record resolves the hostname of yourinstance to the static IP address of your instance. We show you how to do this in the next section ofthis guide

Step 5: Map your domain name to your cPanel & WHM instance

You can map a domain to your cPanel & WHM instance, which you can use to access the WHM console. You can also map multiple domains within WHM, which you can use to manage websites within WHM. This section describes how to map your domain to your cPanel & WHM instance. For more information about mapping multiple domains within the WHM console, which you do when you create a new account, see Create a new account in the WHM documenttion. 

5.1 — To map your domain name, such as management.example.com or administration.example.com to your instance, you add an address (A) record to the DNS of your domain. The record maps the hostname of your cPanel & WHM instance to the static IP address of your instance. The subdomain that you specify in the A record must be the hostname that you specified in the Step 4: Change the hostname of your cPanel & WHM instance section earlier in this guide.

After the A record is added, you can use the following address to access the WHM console of your instance, instead of using your instance's static IP address. Replace <InstanceHostName> with the host name of your instance. See the following code.

https://<InstanceHostName>/whm

Example:

https//management.example.com/whm

DNS records are typically managed and hosted at the registrar where you registered your domain. However, we recommend that you transfer management of your domain's DNS records to Lightsail so that you can administer it using the Lightsail console.

To do this, sign in to the Lightsail console. On the Lightsail console home page, choose the Networking tab, and then choose Create DNS zone. Follow the instructions on the page to add your domain name to Lightsail. For more information, see Creating a DNS zone to manage your domain’s DNS records in Amazon Lightsail.

Step 6: Edit the firewall of your instance

The following firewall ports are open by default on your cPanel & WHM instance:


• SSH - TCP - 22
• DNS (UDP) - UDP - 53
• DNS (TCP) - TCP - 53
• HTTP - TCP - 80
• HTTPS - TCP - 443
• Custom - TCP - 2078
• Custom - TCP - 2083
• Custom - TCP - 2087
• Custom - TCP - 2089


You may need to open additional ports depending on the services and applications that you plan to use on your instance. Under the Networking tab of your instance’s management page, scroll to the Firewall section of the page, and choose Add rule. Choose the application, protocol, and port or port range to open. Choose Create when you're done.

For more information about which ports to open, see How to configure your firewall for cPanel services in the cPanel documentation.

Congratulations

You now launched cPanel and WHM instance on Amazon Lightsail!

Amazon Lightsail is a great choice to develop, build, and deploy a variety of applications like WordPress, websites, and blog platforms. 

Was this tutorial helpful?

Create a snapshot

Create a snapshot of your cPanel and WHM instance. Follow these two guides to create a snapshot and enable a snapshot

Read the documentation

Read the cPanel and WHM documentation. Find the documentation here

Purchase a license for cPanel and WHM

Your cPanel and WHM instance includes a 15-day trail license. After 15 days, you must purcahse a license from cPanel. For more information, see How to purchase a cPanel license in the cPanel documentation.