As a very first step, we need to configure an EC2 instance and securely SSH into it. To learn how to create an EC2 Linux(Amazon Linux) instance, please refer to my previous article on “Securely SSH into AWS EC2 Linux instance”.
After successful SSH into EC2 instance, we will follow the below steps to deploy a sample NodeJS application on the EC2 instance:
- Install NodeJS and NPM using nvm
- Install Git and clone repository from GitHub
- Install dependencies
- Run the application
- Configure security group to access via public URL
- Access the application in browser
Photo by David Iskander on Unsplash
Install NodeJS and NPM using nvm
Install node version manager (nvm) by typing the following at the command line.