If we look back to the past 10 years the changes that happened on the IT infrastructure is very significant. IT has transformed beyond our recognition over the past few decades. In this modern world, every technology has become a key component for a business. Cloud computing has now become such key component or can be a game changer. Many businesses have now moved to the cloud because of its Flexibility, efficiency and strategic value. So let’s get started on how we can Setup cPanel based Hosting Environment on AWS.

AWS is now presently the most trending and widely used cloud. AWS is a suite of hosting products that aims to take a headache out of traditional hosting solutions.

Before trying this setup you must have an AWS account. Free Tier account is available for a year. You can use this link to sign up an AWS account https://aws.amazon.com/. Also, you must have working knowledge on Linux command lines, Network, AWS, and Cpanel.

Now let’s start the process,

  • Login to to your AWS account
  • Services → VPC or You can directly use https://console.aws.amazon.com/vpc/

(VPC are Virtual Private Cloud which enable us to launch AWS resource into virtual network. Which resembles to a traditional network system that you operate in your DC. But here it uses AWS infrastructure)

  • In your VPC dashboard —> Launch VPC wizard and select VPC with a Single Public subnet

  • Now set a VPC name for your VPC and create the VPC. Here I have named the VPC as “Cpanel”

  • Your VPC is now created, now you can launch your instances into your VPC. To see your VPC, Go to VPC dashboard and click your VPC. VPC will be listed there.
  • Now we need to setup a security group for the VPC. Security Group can be accessed from Services → Security → Security Group.

Create a new security group and set a security group name as well

  • Now Go ahead and create an instance. Again services → EC2 → Launch Instance.
  • I am here using CentOS 6.9 (64bit) AMI.

  • Setup the Network name

  • Add Storage as per your requirement. Here I am adding 30GB SSD considering the limit of my free tier and set the Volume type as General purpose.

  • Now configure the security group and you may use the existing group that we have created on previous step. Review and Launch now

  • New Instance will be created under EC2

  • Please note that key that you have got while creating the instance must be saved properly on your PC and never get lost.. To ssh into the instance we need that key

At this moment this instance does not have a Public IP, We need to set one for the public access..

  • Now we need to set up an elastic IP for the server. Services → Network and Security → Elastic IP→ Allocate New Address. New IP address will be allocated there.

  • Now associate the IP address to the Instance that we have created on previous steps. Select the IP address —> Actions → Associate Address to our Instance.
  • Now go to your Running instances, Select your instance, there you will be able to see your Public DNS and Public IP.
  • edit the security group and add the inbound rules for the better environment. Likewise you can add in your outbound if you have any.

The environment has been setup. Now we need to SSH into our instance and install the Cpanel.

SSH into your server using the key.

Set a pwd for root

To install cPanel & WHM on your server, run the following command:

cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest Wait while it installs (it may take up to 30-40 mins)
Once the installation is completed, Please open your browser, https://your-elastic-IP:2087 

Use root as username and apply the newly set password to login.

Now enjoy your Cpanel hosting in AWS

Do you need any expert advice on How to Setup cPanel based Hosting Environment on AWS?

We have an expert team to guide you

Thanks for dropping by. Ready for the next blog?

How ModSecurity protects WordPress websites

Rahul
Author : Rahul
Written on : 19 Feb, 2019

Who we are ?

Founded in 2010, we are a team of a sysadmins with super awesome server management skills who likes to give super quality support at super affordable price.

Services