Table of Contents
By opting for AWS services one can eliminate the need for investing in hardware resources and just focus on development and deployment of web applications. Amazon EC2 or Amazon Elastic Compute Cloud provides scalable computing capacity which is popularly known as Amazon Web Services (AWS) Cloud.
Click to read more about what is Amazon EC2?
This article provides quick steps to create an EC2 instance in AWS that can be used to install Ubuntu server.
EC2 Instance: How to create an EC2 Instance?
To create an instance you must be logged into your AWS console.
- Click on the link EC2 (after login). If you’re not able to find the link try searching for “EC2”.
- Click on EC2 >> Instances >> Launch Instance.
- Choose an Amazon Machine Image (AMI). A page will open up with the list of AMIs.
- Select Ubuntu Server Ubuntu 22.04 LTS (or, latest version if available)
- Choose an Instance type. Click on the checkbox, General purpose t2 Micro (it may be selected by default).
- Click on Next: Configure Instance Detail. Click on checkbox, Protect against accidental termination. And, leave everything as default.
- Click on Next: Add Storage. In the size field, type your required disk size. By default its 8GB (In case of free tier, Max. 15GB can be alloted). Leave other options as default.
- Click on Next: Tag Instance. Leave as default.
- Click o Next: Configure Security Groups.
- SSH will be added by default. Click Add Rule. Click on the Type. And, add HTTP from the list.
- Again click Add Rule and add HTTPS.
- Leave the settings protocol, port range and source as default.
- Click on review and launch.
- Review Instance & Launch. Click on Launch. A small window will appear for key-pair. From the dropdown, select create a new key pair.
- Enter the name of key pair, keep the name same a project url or name so that its easier to remember.
- Download the key pair i.e. .pem file. And, save it safely. If this key is lost.. you will loose access to the instance.
- Click on launch instance.
- Click on view instance.
After creating an instance, associate an elastic IP with it.
Associate an IP or elastic IP with the EC2 Instance
- Creating the Elastic IP. In the EC2 dashboard. Click on Network & Security. And, then Elastic IPs.
- Click on allocate new address.
- Click on allocate. And, IP will becreated.
- Associate elastic IP with EC2 Instance. On the same window, right click on the IP you just created and click on Associate Address.
- A small window will appear with the name Associate Address.
- Select your respective instance ID from the dropdown (double check if you have more than 1 instances on your AWS account).
- Select private IP from the dropdown.
- Click on Associate.
After the association, connect with the Instance using Putty and the downloaded key-par or .pem file..