How to Launch AWS EC2 instance

How to Launch AWS EC2 instance

How to launch AWS EC2 instance from AWS Console

What’s AWS?

AWS is one dominating cloud platform service that serves businesses with scalable, reliable, and low-cost infrastructure.

With a varied suite of services offered under the AWS environment, one of the most common services is Amazon EC2 (Elastic Compute). Amazon EC2 enables you to scale up or down to handle changes in requirements or spikes in popularity, reducing your need to forecast traffic.

In this article, we are going to dive step by step into building an AWS EC2 instance and connecting to that EC2 instance. We are going to jump straight into the AWS EC2 console.

What is Amazon EC2 Instance?

An Amazon EC2 instance acts as a virtual server in Amazon’s Elastic Compute Cloud (EC2) for running applications on the Amazon Web Services (AWS) infrastructure. As per the AWS documentation.

"You can use Amazon EC2 to launch as many or as few virtual servers as you need, configure security and networking, and manage storage. "

Launching AWS EC2 Instance from AWS Console

1. Login into your AWS Account and open EC2-Dashboard

First things first, navigate to the AWS EC2 Console & open the EC2 Dashboard, it’ll look something like this. 👇

image.png

Click Launch Instance, under the “Launch Instance” section.

2. Fill up the name of your instance

Enter the desired name for your instance, you can change it later.

image.png

3. Select Application & OS Image or AMI

AMI stands for Amazon Machine Image, it’s an OS that will be installed on the server you’re creating. There are a bunch of varieties to choose from like Ubuntu, Windows, Mac OS, etc.

image.png

4. Select the instance type

Here you can select the type of machine, number of vCPUs, and memory that you want to have. Select the free tier eligible option and move to the next step (create new key pair)

Note: make sure to check the pricing structure else you’ll be charged heavily.

image.png

5. Create key pair

Key pairs allow you to connect to your instance securely.

Enter the name of the key pair below & store the private key in a secure and accessible location on your computer. **

You will be needing it later to connect to your instance.

image.png

6. Configure Network Settings or Security Groups

Here you change vpc, subnet and security group, and other configurations. I’m leaving this as default.

image.png

7. Configure Storage required for your instance

Select the amount of storage you want your instance to have, for the free tier you can choose up to 30 GB of EBS.

image.png

Once storage configuration is done, click on launch Instance & initiate the process. After a while, you’ll see your instance running, under EC2 Dashboard > Instances,

image.png

As of now we’ve successfully launched the EC2 Instance & is up and running.

8. Accessing your instance

With the EC2 instance now running we need to do some local setup to allow us to connect to the EC2 instance.

Now comes the interesting part, time to run some terminal commands 🧑‍💻

Right-click on the running instance & click on connect.

Select SSH Client 👇

image.png

  1. Open an SSH client on your system
  2. Now locate the private file you’ve created while creating the key pair in Step 5. The key used to launch this instance is “name_of_your_private_file.pem”
  3. Run the below command if necessary, to ensure your key is not publicly viewable. 👇 chmod 400 name_of_your_private_file.pem
  4. Connect to your instance using its Public DNS:

ssh -i "name_of_your_private_file.pem" ec2_username@Public_IPv4_DNS_Address

Voila!! you’ve connected to the EC2 Instance. Now configure the server accoriding to your requirements.

Food for thought

Now that you’ve successfully became familiar with launching an EC2 Instance, it’s finally time to launch it.

I would encourage you to go through the different screens in the AWS EC2 Console and play around that will eventually help you to learn from experience.

Thanks for taking the time to read this. I hope you find it helpful.

Happy Learning

Any questions in your mind? You know where to find me