-
Notifications
You must be signed in to change notification settings - Fork 0
Deploying Node.js App on an AWS EC2 Instance
This guide serves to provide instructions on how one can deploy a NodeJS application on an AWS EC2 Linux instance.
The steps involving creating an AWS EC2 instance are detailed in the following page:
There are several methods in which you can SSH into your EC2 instance
Amazon EC2 Instance Connect offers a streamlined and secure method for establishing connections to Linux instances using SSH. AWS Identity and Access Management (IAM) policies and principals are used to control SSH access. This method effectively bypasses the need of handling and sharing SSH keys, which simplifies key management. Thus, EC2 Instance Connect will be our preferred method of accessing our instance.
When trying to connect to the instance, we are brought directly to this page where we are given different options to connect to the instance.
Once connected, you are brought into a Linux instance where the Github repository resides.
We install nvm (node version manager) by using the following command:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
Using nvm, we install Node.js with the below command:
nvm install