Launch an AWS AMI Instance
Last modified: January 29, 2020
This document provides the steps to use the Amazon Web Services™ (AWS) cloud service and the cPanel & WHM Amazon Machine Image™ (AMI) to build a production hosting environment.
This document assumes that you will use dedicated DNS instances. You could also use these instructions on dual-use instances that serve as both web servers and nameservers.
We strongly recommend that you read the Amazon AWS User Guide before you begin this process.
You must obtain an elastic IP when you create your server.
We strongly recommend that you host interconnected servers at Amazon® within the same availability zone.
You must purchase a license. New installations automatically receive a free 15-day trial license.
You cannot change your hostname within cPanel & WHM after you launch an instance. Make certain that you configure it before you launch.
An incorrect hostname may cause license errors.
To configure your instance to retain the changed hostname, perform the steps in the Fix hostname issues section below.
Amazon’s AWS platform exists behind a NAT infrastructure. This infrastructure provides a solid hosting architecture that uses the following Amazon AWS features:
To complete this process, you must create and add a key pair to your AWS account and local computer.
For instructions to create and install a key pair, read our Instance Management Tasks documentation.
The key pair must use the same region as the instance.
For video tutorials about this process, view the cPanel and Amazon AWS playlist on our YouTube channel.
Launch an Amazon AWS instance
If your AWS account does not include at least one key pair, you must create one and add it to your local system before you can launch your instance. To do this, perform the following steps:
Sign in to your AWS account.
From the Services menu in the top-left corner, select EC2 under Compute. The EC2 Management Console will appear.
In the left-side menu under Network & Security, click Key Pairs. The list of available key pairs will appear.
Click Create Key Pair. The Create Key Pair window will appear.
Enter a name for the key pair in the Key pair name text box.
Click Create. The list of key pairs will refresh to display the new key pair, and your browser will automatically download the new key pair’s .pem file.
Perform the steps for your computer’s operating system:
On an MacOS™ computer that uses the default download folder:
Run the following command, where
examplerepresents the key pair’s name:
mv ~/Downloads/example.pem ~/.ssh
Run the following command to modify the permissions for the
examplerepresents the key pair’s name:
chmod 600 ~/.ssh/example.pem
Run the following command to add the key pair, where
examplerepresents the key pair’s name:
Identity added message will appear.
On a Windows™ computer that runs the PuTTY client and uses the default download folder, perform the following steps:
From the Windows Start menu, open PuttyGen.
Under the Conversions heading, click Import.
Navigate to the PuTTY Key Generator interface. and click Open.
Enter a passphrase in the Key passphrase and Confirm passphrase text boxes.
Click Save private key and save the key as a
From the Windows Start menu, open PuTTY.
In the Session interface, from the Saved Sessions menu, select your preferred authorization session and click Load.
Navigate to the Auth interface under the SSH category.
Click Browse, select the private key file to upload, and click Open.
For instructions on how to access the command line, read our How to Access the Command Line documentation.
After you create and add the new key pair, it will automatically appear in the list during the instance launch process.
In the top-right corner, click Continue to Configuration. Then, confirm that the system uses 64-bit (x86) Amazon Machine Image (AMI) in the Fulfillment Option menu.
By default, the system uses the AMI’s default version to configure the instance version. Under Version, verify whether the system selected the desired AMI version. To select a different version, click Version and select a version.
To improve security for your system, the cPanel & WHM AMI automatically runs the
/usr/local/cpanel/upcpscript after the instance initializes. This script may alter the AMI’s version number.
Under Region, ensure that AWS automatically selected the correct region. To select a different region, click Region and select a region.
You must configure the key pair and instance to use the same region.
- If they do not use the same region, you cannot use the key pair with the instance.
- You cannot edit the instance region after you launch the instance.
In the top-right corner, click Continue to Launch. Then, in the Choose Action menu, select Launch from Website.
Under EC2 Instance Type, select the instance type that you wish to use. The list of instance types includes all of the types that the cPanel & WHM AMI supports.
Your EC2 instance type determines the rate at which AWS bills you.
Make certain that you select an instance type that includes appropriate resources for the type of system that you wish to run. If you will host a large number of websites or multimedia content, you must choose an instance type that exceeds our minimum system requirements.
We strongly recommend that you do not install cPanel & WHM on servers that rely on snapshot data (for example, Amazon EC2™ Spot instances). When these servers revert to snapshot data, the system detects this action as a uniqueness change. This behavior causes these servers’ cPanel & WHM licenses to lock due to the uniqueness changes for that server’s cPanel & WHM license. A locked license disables a cPanel & WHM server.
To configure your VPC and subnet settings, perform the following steps:
Under VPC Settings, verify the Virtual Private Cloud (VPC) that the system selected.
- To change one of these settings, click VPC Settings and select the desired VPC.
- To create a new VPC, click Create a VPC.
Under Subnet Settings, verify the subnet that the system selected.
- To change the subnet, select the appropriate subnet from the menu.
- To create a new subnet, select Create a subnet.
For more information, read Amazon’s VPCs and Subnets documentation.
Under Security Group, verify the new instance’s port and security settings.
We strongly recommend that you select Create new based on seller settings.
- We recommend that only advanced users select default.
- cPanel, L.L.C. has configured the Create new based on seller settings settings to meet cPanel & WHM’s requirements and improve security for your system.
Enter a name for the security group in the Name your Security Group text box.
Select the desired key pair from the Key Pair menu.
At the bottom-right corner of the page, click Launch. A confirmation page that lists all of your instance’s information will appear.
Click Launch to launch the instance. A success message will appear
Click Previous to return to the cPanel & WHM AMI listing in the AWS Marketplace.
Click EC2 Console to navigate to the EC2 Management Console which will display your new instance. The EC2 Management Console allows you to launch EC2 instances, manage or check instance status, view DNS information, and other instance management tasks.
New instances may require several minutes to initialize. Until the initialization process finishes, the Status Checks column of the EC2 Management Console will display Initializing and an hourglass icon.
If you stop and restart your instance, Amazon will assign a different IPv4 address to the instance. cPanel & WHM requires a permanent IP address for all installations. Therefore, you must assign an elastic IP address to the instance to set a permanent address for the server.
To assign an elastic IP address to the instance, perform the following steps:
In the left sidebar, scroll down to the Network & Security section and click Elastic IPs. The Elastic IPs interface will appear.
Click Allocate new address.
Click Allocate. A success message will appear.
Select the checkbox next to the new elastic IP address that you just created.
Click Actions and select Associate address.
Under Resource type, select Instance.
In the Instance menu, select the new instance that you just created.
In the Private IP menu, select the elastic IP address that you just created.
Unselect the Reassociation checkbox.
Click Associate. A success message will appear.
Click Close. The instance’s private IP address will appear under the Private IP address column.
To log in to the server via SSH and promote yourself to the
root user, run the following commands, where
IPADDRESS represents the server’s public (elastic) IP address.
The server will respond with a Message of the Day that contains helpful links and a URL where you can log in to cPanel & WHM.
To log in to WHM, perform the following steps:
In your preferred browser, navigate to the cPanel & WHM login URL. A new interface will appear.
Agree to the software license. A new interface will appear.
Enter the your contact information and nameserver information. The WHM Home interface will appear.
You must purchase a license for cPanel & WHM. New installations automatically receive a free 15-day trial license.
The system evaluates the password that you enter on a scale of 100 points.
0indicates a weak password, while
100indicates a very secure password.
Some web hosts require a minimum password strength. A green password Strength meter indicates that the password is equal to or greater than the required password strength.
Click Password Generator to generate a strong password. For more information, read our Password & Security documentation.
To change the
root user’s password, perform the following steps:
Navigate WHM’s Change Root Password interface (WHM >> Home >> Server Configuration >> Change Root Password).
Enter and confirm the new password in the appropriate text boxes.
Click Change Password.
After you configure the
root user’s password, you can log in to WHM at the following URL, where
IPADDRESS represents your server’s IP address:
For more information about WHM and how to configure your server, read our WebHost Manager documentation.
After you agree to our software license, you’re ready to configure cPanel & WHM.
For more information, read our WebHost Manager documentation.
For more information about how to quickly publish a website on a newly-created cPanel & WHM server, read our From WHM to Website documentation.
For information about how to manage the newly-created instance, read our Amazon AWS Instance Management documentation.
If you change your hostname after you launch your instance, AWS will reset it to the original hostname each time that the instance reboots. To resolve this issue, run the following command:
printf 'preserve_hostname: true\nmanage_etc_hosts: false\n' > /etc/cloud/cloud.cfg.d/99-preserve-hostname.cfg