How To Create EC2 Instance In AWS With Ubuntu 18.04 And 20.04 – Step By Step Video Guide

Create EC2 Instance In AWS With Ubuntu

What is AWS EC2 Service?

AWS EC2 is a cloud-based server hosting system that is used to create on-demand servers within seconds. It allows you to create servers of various hardware configurations and your choice of the operating system.

If you’re new to AWS and wish to explore around, Amazon offers a “free tier” option to get started. Today I’ll show just how you can create an EC2 instance in AWS with Ubuntu 18.04.
That being said, true beauty lies in the simplicity Amazon AWS offers to its users to create and deploy EC2 instances on-the-fly.

Before we begin, you need to sign in and go to Services > Compute > EC2.
Scroll down a little and you should click on “Launch Instance”

Step 1: Select Amazon Machine Image

l

AMI means the operating system you want to install on your server.
There multiple options here like Ubuntu, Redhat, Windows Server but we’re just gonna stick with Ubuntu 18.04.

Step 2: Choose An Instance Type

Instance types on AWS are divided into 4 families:

  1. General Purpose
  2. Compute Optimized
  3. Memory Optimized and
  4. GPU Optimized

We’re going to select a configuration from General Purpose because it has a good balance between CPU and RAM usage.
CPU Optimized instances are fine-tuned to get maximum out of the CPU and are good for CPU intensive workloads.
Memory Optimized instances are fine-tuned to perform for memory-intensive workloads.
GPU Optimized instances have graphics processing capabilities and are useful for workloads such as animation, video editing, 3d rendering, etc.

We’re going to select “t2.micro” from General Purpose which has 1 vCPU and 1 GB RAM which should be sufficient for our demo.

Step 3: Instance Configuration

Configure EC Instance Details

Moving on, we’re just going to create one instance so I’m going to leave this and other settings as they are and go to the next step.

Step 4: Add Storage To Your Instance

Add Storage To EC2 Instance

Now, we must add storage to our instance. I’m going to add 20 GB of EBS or electronic block storage.
I’m going to keep the volume type as “General Purpose SSD” because I’m going to be using the EC2 instance as a small webserver.
You can choose “Provisioned SSD” if you plan on running intensive workloads where the number of read-write operations per second is very high.
It is mandatory to add this storage because EC2 instances don’t come with storage of its own.

EBS’ existence is independent of the core instance which makes it possible to detach a storage volume from one instance and attach it to another instance without any hassle.
You can also scale your storage size with little or no downtime.

Step 5: Add Tags (Optional)

Add Tags To EC2 Instance

This is an optional step and is particularly useful if you want to group or identify instances based on various key-value pairs.
For e.g., if you have multiple EC2 instances dedicated to a website(vikaswani.com), you can tag them with key – “website” and value “vikaswani.com”.
Tagging is useful for searching resources across AWS and not just EC2.

Step 6: View Summary and Launch

Review and Launch EC2 Instance

Next, we proceed to the summary which shows exactly what type of server we’re about to create.
Then we click on launch.

Step 7: Create SSH Private Key

Create SSH Private Key

Now, you can access your server with either username and password or with an ssh key.
I won’t recommend username and password so I’ll just continue with ssh key mainly because it provides added security and eliminates the possibility of guessing the password.
So I create a new key pair and download it.
Make sure you keep this private key safe as this is what we’ll need to access our server.
Note: The private key cannot be downloaded at a later stage.

Step 8: Log In With PuTTY

Log In With PuTTY

To log in to our server we’ll need SSH software like PuTTY.
Before we start using Putty, we need to convert the “.pem” file to “.ppk” file using PuTTYgen.
So to do that, let’s open PuTTYgen and open the “.pem” file. Now, we save the key to “.ppk” file.

Configuring PuTTY To Access AWS EC2 Instance

  1. Enter your instance’s IP address in “host name” field
  2. Select private key (.ppk file) in the field under Connection > SSH > Auth
  3. Type “ubuntu” in Connection > Data > Auto-login username
  4. Save session settings and click “OK”

EC2 Instance Console
That’s it! We’ve now logged into our server.

I hope you liked this article. If you did, please like and share it and Subscribe to my YouTube channel for more videos.

Thank you so much guys and I’ll see you in another video.