Install cPanel & WHM on AWS EC2 Instance

how to upgrade kernel in centos 7
How to Upgrade the Linux Kernel on CentOS Server
December 16, 2019
How to Install cPanel on Google Cloud
How to Install cPanel on Google Cloud
December 16, 2019

Install cPanel & WHM on AWS EC2 Instance

Install cPanel & WHM on AWS EC2 Instance

Install cPanel & WHM on AWS EC2 Instance

Install cPanel & WHM on AWS EC2 Instance with CentOS 7

Install cPanel & WHM on AWS EC2 Instance with CentOS 7 and set up Email and Security using Web Host Manager (WHM). This latest version simplifies the WHM setup in just two clicks compared to the installation of the old cPanel version.

cPanel is a server management software for website owners which comes with a 15-day trial.

Click here to activate cPanel License

Steps to install cPanel and WHM

  1. Create an EC2 Instance
  2. Setup Route 53 DNS
  3. Configure Security Group
  4. Set up Hostname on AWS
  5. Install cPanel
  6. Agree to Terms and Conditions
  7. Setup Email in WHM
  8. Activate cPanel

Cpanel and WHM can also be installed on other cloud platforms. You can choose any one from below.

Here are some options.

PlatformMachine TypeCost (Monthly)
Digitalocean4GB RAM – 2vCPU$20
Google Cloud PlatformStandard 3.75 GB RAM$25
Amazon Web ServicesA1- Large 4 GB RAM$35
Check how to install cPanel on Google Cloud Platform.

Create an EC2 Instance

Launch a new EC2 Instance with CentOS 7 Amazon Machine Image.

Choose at-least t2 micro instance type.

Add 40 GB of Storage to your root volume.

Configure Security Group by adding rules for these custom ports.

  • SSH with source anywhere (You can also restrict it)
  • HTTP with source anywhere
  • HTTPS with source anywhere
  • DNS (UDP) with source anywhere
  • DNS (TCP) with source anywhere
  • Custom TCP 2077 with source anywhere
  • Custom TCP 2078 with source anywhere
  • Custom TCP 2082 with source anywhere
  • Custom TCP 2083 with source anywhere
  • Custom TCP 2086 with source anywhere
  • Custom TCP 2087 with source anywhere
  • Custom TCP2096 with source anywhere
  • Custom TCP 3306 with source anywhere
  • Custom TCP 2525 with source anywhere

Create an instance by creating a new pem key to access your instance using SSH. Keep this key safe, without this key you cannot access the instance.

Setup Route 53

Create a new DNS Hosted zone for your domain name and update the nameservers of Amazon on your domain name.

In your DNS manager create a new A record with the name cpanel which points to the Public IP Address of the instance.

You can check your DNS records here by entering

Once everything is in place you can go ahead and install cPanel.

Install cPanel

Access your EC2 Instance with the PEM file you just downloaded.

Once you are connected to your instance enter the following commands one by one.

sudo -s
yum update
yum install perl
yum install wget

Then set the hostname with your domain name. Replace with your domain name.


Download the latest cPanel and install it by running the following command.

cd /home && curl -o latest -L && sh latest

It will take around 30 – 40 min to complete the install. Don’t close the terminal until the setup is completed.

Once the setup is completed, you can set the root password by executing the following command.


Save your password safely, you will need that to login to your WHM.

Set up Hostname in AWS

AWS Instance won’t preserve the hostname ( you set and changes it to default hostname automatically, so this may result in a locked cPanel & WHM license. To preserve the hostname follow the below simple steps .

cd /etc/dhcp/dhclient-exit-hooks.d/
sudo nano

Paste the following contents and hit Ctrl+X followed by Y to save the file. Remember to replace with your domain name


Set correct permissions to the file you created

chmod 744

That’s all now your cPanel is installed and ready to finish the WHM setup

Setup WHM

Open your browser and navigate to . At this point, some browsers show a warning message about HTTPS and don’t allow you to visit the WHM page. In this case, you can use your IP Address instead of the domain name (https://PUBLIC_IP_ADDRESS:2087). It will take some time for the SSL certificate to get issued by cPanel.

Install cPanel on AWS EC2 Instance

Enter username as root

Enter the password you created by running the command passwd

Now you will be logged into your WHM.

Click Agree to All.

Provide your email address.

Install WHM on AWS EC2 Instance

Click Finish

Now you will be taken to the WHM home page.

Install cPanel & WHM on AWS EC2 Instance

Setup Email in WHM

In AWS port 25, which cPanel & WHM utilizes for email is not open. So you need to create an account with Mailgun or Sendgrid and integrate with WHM for emails or Configure Amazon SES.

Allow SMTP on Port 2525

Go to Service Configuration >> Service Manager

Tick both boxes next to Exim Mail Server (on another port)

Change Allow Exim to listen on a port other than 25 to 2525

Click Save

Email Configuration

As the standard email port is blocked in Google Cloud, you need to configure a third-party email service provider to send emails. Here we can use Mailgun to configure emails in cPanel.

Make sure you have these DNS records.

A record pointing to

MX record with 0 priority pointing to

Mailgun Configuration

Go to Service Configuration >> Exim Configuration Manager.

Click the Advanced Editor tab.

In daemon_smtp_ports enter 465 : 25 : 587 : 2525

In the Section: AUTH box enter.

driver = plaintext
public_name = LOGIN
hide client_send = : Default SMTP Login : Default Password

In the Section: PREROUTERS box enter.

driver = manualroute
domains = ! +local_domains
transport = mailgun_transport
route_list = * byname

In the Section: TRANSPORTSTART box enter.

hosts_try_auth =

Activate cPanel

cPanel is a subscription-based software, you can activate your license.

Save the configurations, that’s everything about cPanel & WHM on AWS.


  1. Hi there, I think your website might be having internet browser compatibility problems. When I take a look at your site in Safari, it looks fine however, if opening in Internet Explorer, it has some overlapping issues. I simply wanted to give you a quick heads up! Besides that, wonderful blog!

  2. Aaonoznt says:

    cialis paiement paypal cialis does blue cross cover cialis

  3. Thanks for every other informative website. Where else may just I am getting that kind of info written in such a perfect method? I have a venture that I am simply now working on, and I’ve been at the glance out for such information. grönt marmor skal

  4. hokOntof says:

    Добрый день.
    Подскажите нормальную онлайн-типографию для изготовления буклетов
    Мы работали с одной типографией, качество, цены и скорость у них отличное,
    но они размещаются в Красноярске, а мне хотелось бы в Новгороде.
    Это печать открыток

  5. Практически все когда-нибудь сталкиваются с ситуацией, когда ему требуется компетентная правовая помощь и совет профессионального адвоката. Зачастую рекомендация компетентного адвоката дает возможность найти простое решение проблемной ситуации или даже предотвратить ее возникновение. Для того чтобы это стало возможным, нужно найти хорошего адвоката.
    А как понимать быть хорошим адвокатом? Наша правовая организация считает, что профессиональный юрист обязан обладать профессиональным опытом, превосходно знать постоянно меняющуюся судебную практику, что особенно актуально в нашем государстве, последовательно и успешно защищать каждого своего клиента. Только такой юрист может быть признанным среди коллег.
    Наша адвокатская фирма была основана в 2010 году. Наша правовая компания представляет права граждан по вопросам уголовного, административного права, защищает права своих доверителей в делах по административным нарушениям.
    Мы сотрудничаем с большой командой профессиональных юристов и адвокатов, имеющих специализацию в различных отраслях права. Каждый адвокат адвокатской фирмы состоит в адвокатской коллегии – одном из самых авторитетных адвокатских сообществ в Днепре.

  6. Essays on the industrial revolution in europe .

    Proceed to Order!!!


  7. Georgetaich says:

    Варианты быстрого получения второго гражданства за инвестиции можно посмотреть здесь:

    гражданство за инвестиции в недвижимость

  8. hokOntof says:

    Хорошего дня.
    Порекомендуйте путнюю типографию для изготовления брошюр
    Могу посоветовать одну типографию , качество, цена и скорость у них хорошее,
    но они размещаются в Красноярске, а мне нужно в Новосибирске.
    Это печать открыток

  9. RamonIsomb says:

    Официальный интернет-магазин садово-парковой техники “Oleo-Mac”.
    Предлагает высококачественную технику от итальянской компании Олео-Мак.
    Так же комплектующие и заточное оборудование Oregon. На сайте можно сделать онлайн-заказ.

  10. Znalazlem bardzo dobry Serwis telefonow w Warszawie.
    Wymienilem tam baterie w swoim Samsungu i jestem bardzo zadawolony!!
    Serwis Telefonow

  11. Jameskig says: – Лучшие идеи дизайна интерьера переходите на сайт

  12. Tus says:

    This advice on Wyoming divorce incorporates divorce and separation forms divorce law, child care calculators and guidelines, and even a lot much more.

Leave a Reply

Your email address will not be published. Required fields are marked *