12 Steps to set up your First EC2 instance using AWS
An instance is a virtual server in the AWS cloud. With Amazon EC2, we can set up and configure the operating system and applications that run on our instance. The instance is an Amazon EBS-backed instance (meaning that the root volume is an EBS volume). We can either specify the Availability Zone in which our instance runs or let Amazon EC2 select an Availability Zone for us. When we launch the instance, we secure it by specifying a key pair and security group. When we connect to the instance, we must specify the private key of the key pair that we specified when launching your instance.
We can launch an instance using the AWS Management Console as mentioned in the below steps:
1. Open the Amazon EC2 console
2. From the console dashboard, choose Launch Instance
3. Then Choose an Amazon Machine Image (AMI) page displays a list of basic configurations, called Amazon Machine Images (AMIs), that serve as templates for our instance. Select the HVM edition of the Amazon Linux AMI.
4. On the Choose an Instance Type page, we can select the hardware configuration of our instance.
5. Choose Review and Launch to let the wizard complete the other configuration settings like Security group configuration, VPC configuration, Subnet Configuration.
6. On the Review Instance Launch page, under Security Groups, we’ll see that the wizard created and selected a security group for us. We can use this security group, or alternatively, we can select the security group that we created when getting set up using the following steps:
- Choose Edit security groups.
- On the Configure Security Group page, ensure that Select an existing security group is selected.
- Select the security group from the list of existing security groups, and then choose Review and Launch.
7. On the Review Instance Launch page, choose Launch.
8. When prompted for a key pair, select Choose an existing key pair, then select the key pair that we created when getting set up. Alternatively, we can create a new key pair. Select Create a new key pair, enter a name for the key pair, and then choose Download Key Pair. This is the only chance for us to save the private key file, so be sure to download it. we’ll need to provide the name of the key pair when we launch an instance and the corresponding private key each time we connect to the instance. Don’t select the Proceed without a key pair option. If we launch the instance without a key pair, then we can’t connect to it.
9. When you are ready, select the acknowledgement check box, and then choose Launch Instances.
10. A confirmation page lets us know that the instance is launching. Choose View Instances to close the confirmation page and return to the console.
11. On the Instances screen, we can view the status of the launch. It takes a short time for an instance to launch. When we launch an instance, its initial state is pending. After the instance starts, its state changes to running and it receives a public DNS name. (If the Public DNS (IPv4) column is hidden, choose Show/Hide Columns (the gear-shaped icon) in the top right corner of the page and then select Public DNS (IPv4).)
12. It can take a few minutes for the instance to be ready so that you can connect to it. Check that your instance has passed its status checks; you can view this information in the Status Checks column.