Hello everyone. I hope you all are safe. In this article, we are going to discuss how to create an AWS instance and host your Node.js application with Nginx. You will learn how to get your Node.js application up and running in a few minutes with AWS.
What is AWS?
So in one line, AWS stands for Amazon Web Services and it is the cloud computing platform from Amazon; for more you can read here.
What is EC2?
EC2 stands for Amazon Elastic Compute Cloud (Amazon EC2) and it is a web service that provides various compute capacity in the cloud. It lets us create the desired computing environment quickly. For example, if you need a server up and running for you to test or deploy your application it will take only a minute or two to set up your server in EC2.
So let us create a virtual machine and host a node application. At first, you need to have an AWS account. if you're a student then there is an easier way to get an AWS account using GitHub Student Developer Pack you can check it out here.
Step 1
Go to AWS and click on AWS Management Console under My Account then choose Root user or IAM user based on the description and enter your email.

Click on next and then enter your password and click on Sign in.

Step 2
After signing in you will see this screen under the compute; click on EC2 then you will be presented with the below screen.

Click on launch instance.

Step 3
Then choose your preferred server image, I want to install an Ubuntu server so I will proceed with this.

Then I will choose the free tier. What is the free tier?
In this tier, for the first 12 months following your AWS sign-up date, you get up to 750 hours of micro instances each month. When your free usage tier expires or if your usage
exceeds the free tier restrictions, you pay standard, pay-as-you-go service rates.

Step 4
Click on Configure instance details I will leave everything default here.

Step 5
Click on next to add storage. The default provided storage is 8 GB you can add more as per your need.

Step 6
Now click on the next to add a tag. A tag consists of a case-sensitive key-value pair. For example, you could define a tag with key = Name and value = Webserver. So I am adding node instance.

Step 7
Click on next Configure Security Group

Step 8
Then click on review and launch now.

You will be asked to choose a key pair for authorization purposes. Choose to create a new key-pair and enter the name of your Key Pair and then click on download Key Pair.
You need to keep it safe.

Click on view instance and you will see your instance running

You will see the newly created instance is running.

Step 9
Choose your instance and click on connect, now we will be using SSH client in our case it will be putty.

If you're on windows then you can download putty here and if you're Linux then you can install putty using your terminal. For Linux, these are the commands.
- sudo apt-get update
- Sudo apt-get install -y putty
- putty
Now to connect you need to convert your keypairname.pem file to keypairname.ppk for authorization purposes. You can read how to do it. So after converting launch Putty and follow the steps to connect.









Join the conversation! Your thoughts help the community grow.