Creating an EC2 Instance on AWS - A Step-by-Step Guide for Beginners

March 4, 2024

What is AWS?

AWS is Amazon’s Cloud Service.

It let’s you

  1. Rent servers

  2. Upload objects (mp4 files, jpegs, mp3s …)

  3. Autoscale servers

  4. Create k8s clusters

The offering we will be focusing on today is Renting servers.

Prerequisites: Before we dive in, ensure you have the following:

  1. An AWS account.

  2. SSH key pair for accessing your EC2 instance.


What is an EC2 instance?

Virtual Machines on AWS are called EC2 (Elastic Compute Cloud).

  1. Elastic: As the name suggests, we can increase/decrease the size of the machine.

  2. Compute: It is a machine.

You can fire up a new EC2 instance from the AWS dashboard.

image


Creating a new EC2 instance

  1. Click on Launch Instances.

image

  1. Give a name to your instance.

image

  1. Select an Operating System (OS).

image

  1. Select Size

image

  1. Create a new key pair.

image

Now create a new key pair by providing a name, then click on create key pair.

image

Now it’ll download a test101.pem file.

image

  1. Select Storage Size

image

  1. Allow traffic on http/https.

image

  1. Launch the instance

image


Connection using SSH into instance

First open your terminal and then navigate to the folder where your test101.pem has been downloaded.

Terminal window
cd Downloads
  1. Give SSH Key Permissions.
Terminal window
chmod 700 test101.pem
  1. SSH into machine

Copy the IP address of the instance.

image

Terminal window
ssh -i test101.pem ubuntu@54.89.21.166
  1. It’s Done!

image

As you can see our Linux server is running.

image

Congratulations! You’ve successfully created your first EC2 instance on AWS. You can now start using it for various purposes such as hosting websites, running applications, or conducting experiments in a sandbox environment.


Conclusion

Creating an EC2 instance on AWS is a straightforward process, especially with this step-by-step guide for beginners. By following these steps, you can quickly set up your own virtual server in the cloud and start exploring the vast possibilities of cloud computing with AWS. So, what are you waiting for? Dive in and start building your cloud infrastructure today!

Zoom overlay