How to Install and Configure Node.js on EC2 Instance Amazon Linux 2
- Mohammad Abu Mattar
- Cloud Computing
- 07 Nov, 2022
- 02 Mins read
Introduction
Node.js does not exist in the default Amazon Linux 2 repository. So, we need to add the Node.js repository to the system. In this post, we will learn how to install and configure Node.js on EC2 Instance Amazon Linux 2.
Prerequisites
- AWS Account
- EC2 Instance Amazon Linux 2
- SSH Client
Step 1: Update the System Packages and Install Dependencies Packages
First, we need to update the system packages and install dependencies packages.
Step 2: Install Node.js
First, we need to install Node.js on our EC2 Instance. To do that, we need to add the Node.js repository to the system. To add the Node.js repository, we need to run the following command:
Step 3: Install Node.js
After choosing the Node.js version, we need to install Node.js on our EC2 Instance. To do that, we need to run the following command:
Step 4: Check Node.js Version
After installing Node.js, we need to check the Node.js version. To do that, we need to run the following command:
Output depends on the Node.js version that you choose.
Conclusion
In this post, we learned how to install and configure Node.js on EC2 Instance Amazon Linux 2. We learned how to add the Node.js repository to the system and install Node.js on our EC2 Instance.