Host a website on Amazon AWS step by step guide

1.Sign in to the console using AWS credentials.

You will see a page listing all AWS web services:




2.Click on “EC2” to go to EC2 dashboard:QQ20160515-1



3.Click on “Launch Instance” to start the process of  creating a new EC2 instance:


Notice: there should be a step to create security key pairs for later access to running EC2 instance. But since I’ve already created one in my account, the system skips the step. Just remember to save the private key to a safe place, we will need it to SSH into the instance later.


3.1Choose AMI

Here I will just choose the forth one: Ubuntu Server.



3.2Choose Instance Type

Here just choose the default one:



3.3Configure Instance Details

Here we can keep everything default, no need to change any settings:




3.4Add Storage

Here we can keep everything default, no need to change any settings:




3.5Tag Instance

Here the Value we put will be the name of this instance, and it will be displayed on our AWS EC2 dashboard:




3.6Configure Security Group

This step is very important!

Firstly, I want to talk about my failure experience:

According to my experience, normally if I start something new, default is most likely to be a good choice.

So for “Assign a security group”, I selected the “Select an existing security group” radio button, and chose the first security group listed, whose name is “default”. The following is the screenshot:


And I just clicked the “Review and Launch” button.

Then I waited for a few minutes for the instance to be running. Sadly, because of the default group setting, I couldn’t SSH into the instance, which means I could do nothing about the instance. The instance was dead for me!


After checking some tutorials, I got to know that I have to create a new security group and add custom access rules. Here is the screenshot of the rules we need:


4.Then we can see the running instance in EC2 dashboard




5.SSH into the instance

In command shell, cd to the directory that the private key is located. Then run this command:

$ ssh -i [private_key_file_name] ubuntu@[public_DNS_address]

For example:



6.Run as root and access website folder

$ sudo su

$ cd /var/www/html/











Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s