Create WHM cPanel on AWS Step by Step

Setting Up an AWS EC2 CentOS Instance: A Comprehensive Guide

Create an AWS EC2 CentOS Instance:

  1. Go to AWS
  2. Go to EC2
  3. Click on Launch Instance
  4. Click AWS Marketplace on the left side.
  5. Type centos
  6. Choose CentOS 7 (x86_64) – With Updates HVM.
  7. Choose t2.micro then Next: Configure Instance Details
  8. Click Next: Add Tags
  9. Click Add Tag and type
    Tag Value
    [any name] WebHosting
  10. Click Next: Configure Security Group
  11. Add The following protocols for inbound traffic
    Type Protocol Port Range Source
    SSH TCP 22 Anywhere
    HTTP TCP 80 Anywhere
    HTTPS TCP 443 Anywhere
    Custom TCP Rule TCP 2087 Anywhere
    Custom TCP Rule TCP 2083 Anywhere
  12. Click Review and Launch
  13. Click Launch
  14. Choose Keypair
  15. It will take a few minutes to launch the instance.

Associate Elastic IP to EC2 Instance

The new instance will have a dynamic IP. You should assign a static IP to your instance to avoid losing your IP when rebooting. For that, do the following:

  1. Go to EC2.
  2. On the right-hand side menu, click Elastic IPs
  3. Create a new IP or choose one from the list that is not associated with any instance then click Action > Associate Elastic IP.

Associate Multiple IP Addresses to EC2

After assigning the primary IP address to your EC2, you can add additional IP (secondary IP) also.

  1. Go to EC2.
  2. Select the instance you want to add secondary IP to.
  3. Then Action > Networking > Manage IP Address
  4. Click Assign New IP and leave the option auto-assign.
  5. On the right-hand side menu, click Elastic IPs.
  6. Click on Allocate Elastic IP Address.
  7. Choose the new IP address and click Actions > Associate Elastic IP Address.
  8. Choose the server then the private IP that you have created.
  9. Now login to SSH and run the following command
    sudo ip addr add [secondary private IP]/20 dev eth0

Install and Configure cPanel

  1. Open PuTTy.
  2. Enter IP address of the server
  3. Username is centos.
  4. Type the following to choose a password for the cPanel root admin
    sudo passwd
  5. Type in the password then confirm the password
  6. Type the following to login as root:
    su root
  7. Type in the following commands:
    yum update
    yum install wget
    yum install perl
    yum install nano
  8. Now you need to set your hostname with the following command. Change [cpanel.yourdomain.com] with your hostname.
    hostnamectl set-hostname cpanel.yourdomain.com
  9. Now install the cPanel with the following command
    curl -o latest -L https://securedownloads.cpanel.net/latest
  10. Then type to install:
    sh latest
  11. After installation is done, copy your IP address the add to the browser. Should look like this : https://22.22.22.22:2087
  12. Login to cPanel as root
  13. Click Agree
  14. Enter your email and then your nameserver (NS1 and NS2).
  15. Now go to Server Configuration > Basic WebHost Manager.
  16. At the bottom of the page, under Nameservers, click Configure Address Records.
  17. Add the IPv4 A record (for all Nameservers). Should be your server IP address.

Leave a Comment