Creating Your First EC2 Instance – AWS EC2 Tutorial For Beginners (Amazon Web Services)
Introduction – AWS Ec2 Tutorial
EC2 (Elastic Compute Cloud ) is a web service by Amazon which provides secure, reliable, and resizable compute capacity in the cloud, with the help of EC2 you can set up your Linux server which can be used to host your web applications, databases etc.In EC2 you can launch several instances and configure these instances according to your needs, with the help of EC2 you can choose amount of memory, CPU, instance storage, and operating system you want to install on the instance.you have complete control over these instances you can start, stop, restart or terminate your instances anytime.you can also increase or decrease the capacity of these instances anytime.With the help of this AWS EC2 tutorial, you will learn how to create and configure your instance step by step so let’s get started.
What is an instance?
Most of the beginners get confused by the word “instance” well to simplify things think of an instance as a computer which is lying somewhere in the cloud and you can choose the amount of memory, type of CPU, storage and operating system you want on this computer, whenever we say instance we are referring to that computer.
Creating your first instance
There are different methods with which we can use AWS Services such as AWS CLI (command line interface), AWS SDK’s (Software development Kits) but for the sake of simplicity, we will use AWS Console which is a GUI(Graphical user interface).
Step 1 – Login to your AWS Console and click on the products tab and select EC2 from the list as shown in figure below
Step 2 – After selecting EC2 you will be redirected to the EC2 dashboard where you will get all the information about your instances.
Notice in the above figure in resources tab it says “You are using following Amazon EC2 resources in the US West(Oregon region)”, let’s understand this line. in AWS there are different regions and end points in which you can launch AWS services, this approach is used to reduce data latency. You can select any region from the drop-down in the menu bar if you are launching an EC2 instance in Oregon this means that you will be allocated a computer which is lying in a data center of Oregon and all the requests will be served by this data center only.All the different available regions are shown in the figure below.
Step 3 – Now click on the “Instances” option in the sidebar and click on “Launch Instance”, now you have to choose an AMI(Amazon Machine Image) which is just a fancy name for operating system, select AWS Marketplace and search for Ubuntu 16.04 (In this tutorial we will launch a Linux instance ), select the first option from the search results , note on the AMI it is written Free Tier Eligible ( by selecting Free tier eligible AMI’s you will not get billed).
Step 4 – After selecting the AMI you have to select the instance type, make sure you select “t2.micro” instance which is free tier available, with this instance you will get 1 CPU, 1GB Ram and 20GB of Hard Disk Space for free.After selecting the instance type click on “Next: Configure Instance Details”.
Step 5 – Oninstance details page do not change anything and click “Next: Add Storage” on this screen change the size of the volume from 8GB to 20GB. Now click on “Review And Launch” there are some other settings also but for the sake of simplicity we will not get into those settings.
After clicking on “Review And Launch” you will get a review screen where you will be presented with all the details of the instance just click on “Launch”. A popup will appear where it asks you to create a new key-pair (it will be used to connect to the instance)give any name to the key-pair and click on download key-pair , A file with the extension .pem will be downloaded to your system make sure you keep it safe on your system we are going to need this file to connect to our instance via SSH(Secure Shell).
After downloading the key pair click on “Launch Instances” and AWS will start initializing your instance and you will get the following screen.
After your instance has been launched successfully you can see your instance on the list with “running” status.
Let me know in the comments below if you face any problem. In the next post, we will learn how to connect to this instance via SSH(Secure Shell).
Don’t forget to check this post – Intro To AWS – Beginners Guide
And to know how to connect to your instance via SSH check out this post – Connect To EC2 Instance via SSH – AWS EC2 Tutorial For Beginners (Amazon Web Services)
Have a good day!