AWS Elastic Compute Cloud(EC2) delivers scalable infrastructure for companies that want to host cloud-based applications. It enables you to scale up or down the applications as per requirement.
Steps for creating an EC2 instance
- First create a budget in AWS console
- In, this we set up the Ubuntu 18.04 server instance
- Login to AWS Management Console
- Go to EC2 Section in AWS Console
- Click the “Launch Instance” button
- AMI is an Amazon Machine Image from which you can select multiple virtual machine images. The machine images are like templates that are configured with an operating system and other software that determine the user’s operating environment.
- Choose AMI, For learning, we can use “Free tier only”, enter the name of Your server in the Name box, press enter, then select the “Ubuntu Server 18.04” AMI.
- Select an instance type that meets your computing, memory, networking, or storage needs. We are using the free tier which is t2.micro.
- configure the security group which allows HTTP traffic then click “Review and Launch”
- We need a key pair to connect the Terminal to Ubuntu Server.
- Select “Create a new key pair”, enter a name for the key pair (e.g. “mern-pair”), and click “Download Key Pair” to download the private key, we will use this to connect to the server via SSH.
Click “Launch Instance”, it will “View Instances” details of the new Ubuntu EC2 instance that is launching.
Connect local Machine Terminal to Ubuntu EC2 Instance via SSH(Secure Shell)
- PEM stands for Privacy Enhanced Mail. The PEM format is often used to represent keys.
- Open the terminal, and navigate towards the file which is the mern-pair.pem.
- If you are using Windows you can connect to your instance via SSH using the PuTTY SSH client. PuTTY(Popular SSH and Telenet Client) is a free and open-source terminal emulator, serial console and network file transfer application.