Amazon EC2 instance is a virtual server in their cloud platform. These EC2 instance are basically used to run various kinds of applications.
Lets follow below step to purchase EC2 Instance.
- Log in to the AWS management console using the url “https://aws.amazon.com/console/” and Click “Sign In to the Console”
- If we already have the logins use the same or sign up a new one from the same page.
- Once logged in we will see home page like below in the screenshot.
- Click EC2 option available.
- Click either “instances” or “Launch Instance” options.I choose “Instances” option there we can see if we already have EC2 instances.
- Then Click “Launch Instance” option.
- Then click “AWS Marketplace” >> “Software Infrastructure”
- We can see lots of Operating Systems Which is currently supported by AWS. I choosed “Centos7” by clicking the corresponding “Select” button.
- In next page we can see different types server hardware specifications available. Choose which one you are looking one and click “Configure Instance Details”
- In this page we can configure our server network settings. But we can leave it as it is if we didn’t have any special requirement. IP address will be assigned the VPS automatically. So just click “Add Storage”
- Here we can define how much disk space we needed for the server and what type of disk type is needed “SSD volume” or “Magnetic type”. Click “tag instance” once we set the disk for instance.
- Here we can basically assign name for the instance we are going to create. Once added the appropriate name click “Configure Security Group”
- In Configure security group section we can define firewall rules to the instance like which ports are opened in the server or not. Once added necessary allow rules Click ” Review and Launch” button
- In the review page we can see all settings we have choose as part of instance creation. Once verified click “Launch” button.
- A popup window will appear for selecting/creating ssh key for instance access. By default there is no password authentication enabled for EC2 instance, only key based SSH access allowed. So we have to create or use an existing one which is already used for another EC2 instance we have. Suppose we are creating a new one, download the same in our local Machine for future use. Click “Launch Instances”
- At the very first moment we can see screenshot like below and after 1/2 minutes browser will automatically redirect to another page which shows “Your instance are now launching”. If we drag the page down we can see an option as “View Instances”, click on the same.
- Here we can see the status of instance creation. Once the instance state is running we will be able to SSH in to the server. In order to know the login details of the instance we created, first select the instance and click ” Connect ” option.
- A new pop up window will appear and shows information about logins and an SSH command used for the same. All we need to do is use the same command in our Linux PC terminal. Before issuing the command just make sure we are in the directory in which the ssh key downloaded or use absolute path in the SSH command we are using.
- Some times we may get message as root access is not allowed, we have use the user as “centos” and su after login to get root privilege.
By completing the above steps we have successfully created and EC2 instance and logged in to the same.