Launch an AWS™ AMI™ Instance

Last modified: March 27, 2024


This document explains how to launch a cPanel & WHM instance on the Amazon Web Services™ (AWS) cloud service. Follow this procedure to launch an instance using the cPanel & WHM Amazon Machine Image™ (AMI).

For video tutorials about this process, view the cPanel and Amazon AWS playlist on our YouTube channel.

  • 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.
  • Due to networking requirements, you cannot run an IPv6-only cPanel & WHM server. You must have at least one IPv4 address.
  • We strongly recommend that you read the Amazon AWS User Guide before you begin this process.
  • An incorrect hostname may cause license errors. If you change your server’s hostname, you must configure the instance to keep the new hostname. To do this, perform the steps in the Fix hostname issues section below.

Launch an Amazon AWS instance

Create a key pair

If your AWS account does not include at least one key pair, you must create one before you can launch your instance. To do this, perform the following steps:

  1. Sign in to your AWS account.
  2. Click Services in the top-left corner, then select EC2 from the Compute menu. The EC2 Management Console will appear.
  3. In the left-side menu under Network & Security, click Key Pairs. The list of available key pairs will appear.
  4. Click Create key pair. The Create key pair window will appear.
  5. Enter a name for the key pair in the Name text box. Do not change any default settings.
  6. Click Create key pair. 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.

After you create the new key pair, it will automatically appear in the list during the instance launch process.

Add a key pair

To access the instance via SSH, you must first add the key pair to your local system. To do this, perform the following steps for your computer’s operating system:

On a macOS® computer that uses the default download folder, perform the following steps:

  1. Run the following command, where example represents the key pair’s name:
    mv ~/Downloads/example.pem ~/.ssh
  2. Run the following command to modify the permissions for the .pem file, where example represents the key pair’s name:
    chmod 600 ~/.ssh/example.pem
  3. Run the following command to add the key pair, where example represents the key pair’s name:
    ssh-add ~/.ssh/example.pem

An Identity added message will appear.

On a Windows® computer that runs the PuTTY client and uses the default download folder, perform the following steps:

  1. From the Windows Start menu, open PuttyGen.
  2. Under the Conversions heading, click Import.
  3. Navigate to the PuTTY Key Generator interface. and click Open.
  4. Enter a passphrase in the Key passphrase and Confirm passphrase text boxes.
  5. Click Save private key and save the key as a .ppk file.
  6. From the Windows Start menu, open PuTTY.
  7. In the Session interface, from the Saved Sessions menu, select your preferred authorization session and click Load.
  8. Navigate to the Auth interface under the SSH category.
  9. 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.

Navigate to the cPanel & WHM AWS Marketplace listing, and choose the AMI you want to install:

Then, click Continue to Subscribe.


WebPros International, LLC only supports AMIs that list cPanel or WebPros International, LLC as the seller. You can find seller information immediately below the AMI listing title.

Subscribe and verify fulfillment

Click Accept Terms to accept the WebPros International, LLC terms and conditions. The subscription process takes a few minutes. You will receive a notification both on the page and via email when the subscription process is complete.

Once the subscription process is complete, in the top-right corner, click Continue to Configuration. Confirm that the system uses 64-bit (x86) Amazon Machine Image (AMI) in the Fulfillment Option menu.

Verify version settings

By default, the system uses the AMI’s default version to configure the instance version. Under Software version, verify whether the system selected the desired cPanel version. To select a different version, click Software version and select a version.

  • To improve security for your system, the cPanel & WHM AMI automatically runs the /usr/local/cpanel/scripts/upcp script after the instance initializes. This script may alter the AMI’s version number.
  • For more information about cPanel & WHM versions, read our Product Versions and the Release Process and cPanel Deprecation Plan documentation.

Verify region settings

Under Region, ensure that AWS automatically selected the correct region. To select a different region, click Region and select a region.

We strongly recommend that you host interconnected servers at Amazon within the same availability zone.

Continue to launch

In the top-right corner, click Continue to Launch. Then, in the Choose Action menu, select Launch from Website.

Select an instance type

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.

Configure VPC and subnet settings

To configure your VPC and subnet settings, perform the following steps:

  1. Under VPC Settings, verify the Virtual Private Cloud (VPC) that the system selected.
    • To change this setting, select the desired VPC from the menu.
    • To create a new VPC, click Create a VPC in EC2.
  2. 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, click Create a subnet in EC2.

For more information about VPC and subnet settings, read Amazon’s VPCs and Subnets documentation.

Configure security settings

Under Security Group, verify the new instance’s port and security settings.

  • We strongly recommend that you click Create New Based on Seller Settings. WebPros International, LLC has configured these settings to meet cPanel & WHM’s security requirements and improve security for your system.
  • We recommend that only advanced users select default.

Click Create New Based on Seller Settings, then enter a name for the security group in the Name your security Group text box. Enter a description in the Description text box. Then, click Save.

Select a key pair

Select the desired key pair from the Key Pair menu.

If you don’t have a key pair available, follow the steps in the Create a key pair and Add a key pair sections of this document.

Launch the instance

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. The system will return a success message and configuration details.
  • In the text box that appears, click EC2 Console to navigate to the EC2 Management Console. This interface allows you to launch EC2 instances, manage or check instance status, view DNS information, and perform 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 a clock icon.

Assign an elastic IP address

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:

  1. In the left sidebar, navigate to the Network & Security menu and click Elastic IPs. The Elastic IP addresses interface will appear.
  2. Click Allocate Elastic IP address.
  3. Click Allocate. A success message will appear.
  4. Select the checkbox next to the new elastic IP address that you just created.
  5. From the Actions menu, select Associate Elastic IP address.
  6. Under Resource type, select Instance.
  7. In the Instance menu, select the new instance that you just created.
  8. In the Private IP menu, select the appropriate private IP address.
  9. Uncheck the Reassociation checkbox.
  10. Click Associate. A success message will appear.

Log in via SSH


Installations can take several minutes to complete. You can monitor the installation process by logging into your AMI instance via SSH.

To log in to the server via SSH and promote yourself to the root user, run the following commands for your cPanel & WHM server’s operating system, where IPADDRESS represents the server’s public (elastic) IP address:

  • For AlmaLinux servers:
    ssh ec2-user@IPADDRESS
    sudo su -l
  • For Ubuntu servers:
    ssh ubuntu@IPADDRESS
    sudo su -l
  • For Rocky Linux servers:
    ssh rocky@IPADDRESS
    sudo su -l

Set the root password

You will need to set the root password before you can access cPanel & WHM.

Set the root password using the command line

To set the root user’s password using the command line, perform the following steps:

  1. Enter the passwd command.
  2. Enter a password.
  3. Enter the password again.

The system will set the root password.

Set the root password using the WHM interface

To set the root user’s password in the WHM interface, you must wait until the cPanel & WHM installation is complete. Then, perform the following steps:

  1. Run the the /usr/local/cpanel/scripts/whmlogin script. This creates a single-use session login URL for WHM.

    Do not run this script until the cPanel & WHM installation is complete.

  2. To navigate to the single-use session, enter the URL in the address bar of your web browser.
  3. Navigate to the Change Root Password interface (WHM » Home » Server Configuration » Change Root Password).
  4. Enter a password, then click Change Password.

Log in to WHM

To log in to WHM, perform the following steps:

  1. In your preferred browser, navigate to the https://IPADDRESS:2087 URL, where IPADDRESS represents your server’s IP address. The WHM interface will appear.
  2. Log in with the root username and password you set.
  3. Agree to the software license. The Get started with a Free cPanel Trial! interface will appear.
  4. You will need to log in to or create a cPanel Store account. For information about how to do this, read our How to Sign Up for a Trial License documentation.
  5. After you log in to the cPanel Store and obtain a trial license, click Server Setup in the WHM interface. The Contact Information interface will appear.
  6. Enter your contact and nameserver information. The WHM Home interface will appear.
  • cPanel & WHM requires a valid license. Since this is a new installation, you can activate a free 15-day trial license.
  • In order to activate a new license, you must have a cPanel Store account with a verified email address.

If WHM displays an error about the license, check which IP address your license uses. To change the IP address that the license uses, perform the following steps:

  1. Log in to
  2. Click Manage Licenses. The Manage Licenses interface will appear.
  3. Locate your server’s license.
  4. Click the down arrow under Actions.
  5. Click Edit IP. A new window appears.
  6. Enter the instance’s new IP address.
  7. Click Save changes.

Configure WHM

After you agree to our software license, you’re ready to configure cPanel & WHM.

For more information about how to configure cPanel & WHM, read our WebHost Manager documentation.


AWS will not automatically open SMTP port 25. You may need to open port 25 to use email services on your instance.

To open port 25, open an AWS support request.

For more information on how to quickly build a website on a newly-installed cPanel & WHM server, read our From WHM to Website documentation.

For information about how to manage the newly-created instance, read Amazon’s AWS Instance Configuration documentation.

Troubleshoot your instance

Fix hostname issues

If your server does not use a resolvable fully-qualified domain name as the hostname, it will automatically receive one from WebPros International, LLC. For more information, read our Automatically-Issued Hostnames 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

Fix installation issues

The cPanel & WHM installation process can fail for reasons not covered in this document.

To learn about common installation problems and solutions, read our Troubleshoot Your Installation documentation.

Additional Documentation