What is AWS EC2?
Hey everyone!
In this blog, we’ll explore what AWS EC2 is. This is the third blog in the DevOps: Laugh, Learn, Repeat series.
If you’re completely new to this, my suggestion is not to overwhelm yourself with too much information. Understand what you can and move ahead ( let the future you suffer 😉 )
What we are going to cover
- What is AWS EC2?
- Create our first EC2 instance.
- Delete the EC2 instance.
What is AWS EC2?
EC2 stands for Elastic Compute Cloud.
EC2 is a web service that provides secure, resizable compute capacity in the cloud. Basically Servers.
You can create your own server and
- choose your OS like Ubuntu, Windows, etc.
- create a firewall.
- configure RAM and secondary memory.
- and many more things.
we will learn all of this in upcoming blogs.
Pricing Models
- On-demand Pricing
- Fixed rates by hour ( or by second )
- For users that want low-pricing and flexibility.
- No up-front payment or long-term commitment.
- For applications that are short-term, spiky, or unpredictable.
In upcoming blogs, we will use this model, but we won’t incur any charges as we have a free tier enabled.
2. Reserved Pricing
- For applications with steady or predicatable usage.
- Make up-front payments to reduce costs.
3. Spot Pricing
- For applications that have flexible start and end times.
- Users with urgent computing needs need a large amount of capacity.
- Amazon EC2 Spot Instances let you take advantage of unused EC2 capacity in the AWS cloud and are available at up to a 90% discount compared to On-Demand prices.
- But if a requirement arises for the unused EC2 capacity, then AWS will terminate the instance or ask you to pay the fees according to on-demand pricing.
4. Dedicated Host
- Used for regulatory compliance and requirements that may not support multi-tenancy.
- Allow organizations to use licenses and certificates on AWS EC2.
Create our first EC2 Instance
Just follow the instructions for now. The purpose right now is to create an EC2 instance. So don’t worry about what we are doing.
Before starting, make sure you are in N. Virginia region. You can choose any region, but if you don’t understand regions, just follow me to avoid charges.
Search for EC2 in the search bar and click on it.
In Side panel, click on Instances
Click on Launch Instances
Now configure as given below
Get Bhavesh Anandpara’s stories in your inbox
Join Medium for free to get updates from this writer.
Set Name as server
Select Ubuntu as the OS and make sure AMI is free-tier eligible to avoid any charges.
Select the instance type as t2.micro, this is free-tier eligible.
Click on Create new key pair
Give key pair name as creds and configure as given below. Click on Create key pair.
A file named creds.pem must be downloaded on your system. I created a new folder in the system named AWS_practical and I will be moving my creds.pem file there.
Create a security group and Allow SSH traffic from and Allow HTTP traffic from the internet.
This is a very crucial step. Otherwise, you won’t be able to SSH into your system.
Click on Launch Instance
Your EC2 instance is now up and running.
Go to Instances from the side panel.
And you have successfully created an EC2 Server 🎉
Let’s SSH into the server
I am using a Windows system so I will be using CMD as my terminal. If you are on Linux system, you can open linux Terminal.
Go to the folder where you have stored your creds.pem file.
Now click on Instance ID of your server.
Copy Public IPv4 address of the instance.
Now, in terminal, run this command
ssh -i creds.pem ubuntu@<your_public_ipv4_address>Once you SSH into the system, you can run any Linux command on the server.
Basically, you have created a Ubuntu server on the internet, which you can access from your system.
You can run your applications here.
Make Sure that you delete your server now that we don’t need it anymore
That’s all for today, folks. Catch up with this series later for more updates on DevOps and AWS from your host and dost — Bhavesh
If you found this helpful, feel free to like it and share your thoughts in the comments! ✨
Next, we will be creating an Apache server and hosting a static website on an EC2 instance.









