How to get started with Amazon Web Services: Part 1 : Start with EC2

Riddhiman Adib
My Online Cafe
Published in
6 min readSep 5, 2016

( This is Part 1 of 3 Part Tutorial series. If you came here just for the “how-to”, skip to the next section. Here’s the link to Part 2 & Part 3.)

Image Credit: Business vector designed by Freepik

The Background

One of the early assignments of my job life was to setup a server, a working solution where we could host our Database, Image Storage as well as APIs to connect with Mobile apps. I was assigned this job. This might seem like a pretty easy job to some of you guys, but not so much when you have literally zero idea on how servers work and when you’re a “noob” in job life, fresh out of university.

So, we started looking for solutions, which was better and which was not. Those who have worked in this sector, have definitely heard of Amazon Web services. Amazon Web Services (AWS) is a industry-standard web service solution. It’s a complete suite which involves a whole bunch of useful web services and known to it’s user-base for it’s reliability, zero-downtime and excellent documentation. Most popular are EC2 (Elastic Cloud Computing), RDS(Relational Database Service), S3(Simple Storage Service) and they belong to IaaS service model. Here’s the intro from Wiki on Amazon AWS:

Amazon Web Services (AWS), a subsidiary of Amazon.com, offers a suite of cloud-computing services that make up an on-demand computing platform. These services operate from 13 geographical regions across the world. The most central and best-known of these services arguably include Amazon Elastic Compute Cloud, also known as “EC2”, and Amazon Simple Storage Service, also known as “S3”.

Amazon Web Services had the best options out of all it’s competitors, very much scalable in every way possible and had a great documentation. And on top of that, it is FREE FOR THE FIRST TWELVE MONTHS. I mean, come on, isn’t that great?

Free Tier

As part of AWS’s Free Tier, new AWS customers can get started with Amazon EC2 for free. After signing up, new AWS customers receive the following EC2 services each month for one year:

750 hours of EC2 running Linux, RHEL, or SLES t2.micro instance usage

750 hours of EC2 running Microsoft Windows Server t2.micro instance usage

750 hours of Elastic Load Balancing plus 15 GB data processing

30 GB of Amazon Elastic Block Storage in any combination of General Purpose (SSD) or Magnetic, plus 2 million I/Os (with Magnetic) and 1 GB of snapshot storage

15 GB of bandwidth out aggregated across all AWS services

1 GB of Regional Data Transfer

So, we just jumped and signed up. We registered with our Credit Cards. We opened the console. Then we saw this.

Amazon Web Services Console

Looked somewhat like this to me:

Just to let you know, this is a Cockpit of an Airplane.

I mean, who puts this amount of options on the landing page?! I was overwhelmed and couldn’t decide where to start. I know, this thing is intended for professionals, not a toy to play with. People who know what to do, definitely admires the console, but I couldn’t. This was so much to start with. And it has a huge huge documentation, one thing that has no

So, this blog is for those who has faced similar problems, who is like me who has a little-to-no-idea on where to start and how to continue.

The Tutorial

Part 1: Amazon EC2

We are going to start with this thing here.

Amazon Web Console

Amazon EC2

Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers.

Amazon EC2 is the starting point on AWS, where you want to start working to setup a server. Think of it as a simple computer, we’re going to setup a server on it. We will create an Instance of EC2, as Amazon calls it, which is practically equivalent to a single computer running. You get to access, control, setup this instance aka computer, and we’re going to use it’s IP address as our server IP address. We’re going to setup a LAMP (Linux-Apache-MySQL-Php) server stack on it. It’s a very popular stack and very easy to configure and use.

In this first part, we’re going to:

  1. create an instance of EC2 (or you may say, “setup a computer”),
  2. control it (using Putty),
  3. setup a LAMP server on it,
  4. and setup File transfer procedures

Creating EC2 Instance

  1. Go to AWS Console page (Look at earlier images).
  2. Remember to pick your preferred zone from the drop-down at the upper-right corner. I picked Singapore, because that’s closest to my target group. You can pick anywhere you want, just remember, the pricing (after free time limit) varies slightly from zone to zone.

3. Click “EC2 - virtual servers in the cloud” (on top left corner).

4. Click “Launch Instance”. Here I already have a running server, so running instance is showing “1 Running Instances”. In your case, it probably shows 0 instances.

5. Choose an Amazon Machine Image (AMI): This is the OS for your server. We are going to select “Ubuntu Server 14.04 LTS (HVM), SSD Volume Type 64-bit” and press “Next”. (Notice the word “Free Tier Eligible”?)

  1. Choose Instance Type: Select “t2.micro — free tier” and press “Next”.
  2. Configure Instance: Leave Defaults and press Next.
  3. Add Storage: Leave Defaults and press “Next”. Point to note, this is default storage in EC2 instance, not Amazon S3.
  4. Tag Instance: In case you need multiple instances of EC2, make a tag with key-value pair, like, key=name, Value-Web-server, for tagging adnd managing multiple instances. It’s not needed right now, as we have only one instance. Press “Next”.
  5. Configure Security Group: In the Port range field enter 22 for SSH and Click ‘Add Rule’ then additionally enter 80 for HTTP. Then click ‘Review and Launch
  6. Review: Review the whole setup and launch.
  7. Choose Security key: Select existing one, if any, or create a new one. To create one, enter a name, download and keep it safe. We will need it later.
  8. Go to EC2 Dashboard and click on Running Instances to see your instance running, along with its details like Public DNS and IP address. Explore this page a bit now.

Remember, if you browse to the IP address using any browser, it will not load, i.e, show error. We need to connect to it using SSH and PEM key downloaded, and setup our server for that.

In the 2nd part, we will use Putty and Filezilla to communicate with our server, and finally get started with RDS and S3. Stay tuned!

If you liked the tutorial series, don’t forget to hit the Recommend button. And follow My Online Cafe for more series on tech stuff.

--

--

Riddhiman Adib
My Online Cafe

Postdoctoral Researcher. Tech Enthusiast. Occasional Blogger. Self-proclaimed Musician. more at: adib2149.github.io