Getting started with Amazon EC2 linux intances
An instance is a virtual server in the AWS cloud with EC2. You can set up and configure OS and applications that run on your instance. Creating an instance involves the following steps.
Step 1 : Launch an instance.
Step 2 : Connect to your instance.
Launch an instance :
- Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
- Click on “Launch instance”.
- The Choose an Amazon Machine Image (AMI) page displays a list of basic configurations, called Amazon Machine Images (AMIs). Select the HVM edition of the Amazon Linux AMI.
- Click on “choose an instance type”. Select
t2.microtype, which is selected by default.
- Select “review and launch”.
- On the “Review Instance Launch” page, under “Security Groups”, choose “edit security groups”.
- On the “Configure Security Group” page, ensure that “Select an existing security group” is selected.
- Further choose “review and launch”.
- Select “launch”.
- When prompted for a key pair, select “Choose an existing key pair”, then select the key pair that you created when getting set up.
- You can also select “create a new pair key” and then choose to download it.
- When everything is ready , “launch instances”.
- Check the “view instances” page for confirmation.
Connect to your instance
You can’t connect to your instance until and unless you launched it with a key pair.
To connect to your linux instance using a web browser follow the below steps.
- You must have Java installed and enabled in the browser.
- Choose Instances in the navigation pane from the Amazon EC2 console.
- Select the instance and then choose “connect”.
- Choose “A Java SSH client directly from my browser”.
- In User name, enter
ec2-user. In Private key path, enter the fully qualified path to your private key (
.pem) file, including the key pair name.
Cleaning up the instance
After you’ve finished with the instance that you created for this tutorial, you should clean up by terminating the instance. If you launched an instance that is not within the AWS Free Tier, you’ll stop incurring charges for that instance as soon as the instance status changes to
shutting down or
To terminate the instance :
- In the navigation pane, choose Instances. In the list of instances, select the instance.
- Choose Actions, then Instance State, and then choose Terminate.
- Choose Yes, Terminate when prompted for confirmation.