How to Install cPanel & WHM on AWS EC2 Instance?
Steps to install cPanel and WHM
- Go to AWS marketplace
- Search for Cpanel & WHM and subscribe to it
- Configure Cpanel & Launch it with EC2
- Configure EC2 & Security Group
- Set up Hostname on AWS
- Connect EC2 & Install cPanel
- Agree to Terms and Conditions
- Setup Email in WHM
- Activate cPanel
Access your EC2 Instance with the PEM file you just downloaded.
Once you are connected to you instance enter the following commands one by one.
yum install perl
yum install wget
Then set the hostname with your domain name. Replace
yourdomainname.com with your domain name.
Download latest cPanel and install it by running the following command.
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && 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 (
cpanel.yourdomainname.com) 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 .
sudo nano set-hostname.sh
Paste the following contents and hit
Ctrl+X followed by
Y to save the file. Remember to replace
yourdomainname.com with your domain name
Set correct permissions to the file you created
chmod 744 set-hostname.sh
That’s all now your cPanel is installed and ready to finish the WHM setup
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 (
It will take some time for the SSL certificate to get issued by cPanel.
Enter username as
Enter the password you created by running the command passwd
Now you will be logged into your WHM.
Click Agree to All.