Front-end Tutorials

Front-end Tutorials

HTMLCSSSassJavaScriptReactJS
CMS Tutorials

CMS Tutorials

WordPress
Tutorials expand

Setting Up Node.js and NPM on AWS Ubuntu EC2

Posted in AWS Tutorial
Updated on Sep 22, 2024
By Mari Selvan
👁️ 111 - Views
⏳ 4 mins
💬 1 Comment
Setting Up Node.js and NPM on AWS Ubuntu EC2

Photo Credit to CodeToFun

🙋 Introduction

When working with Amazon Elastic Compute Cloud (EC2) instances, configuring Node.js and NPM (Node Package Manager) is a common initial step for hosting web applications.

In this tutorial, we'll guide you through the process of setting up Node.js and NPM on an AWS Ubuntu EC2 instance.

📚 Prerequisites

Before you begin, make sure you have the following:

  1. An AWS account with access to EC2.
  2. An Ubuntu EC2 instance launched and accessible.
  3. Configure PuTTY to establish a secure shell connection to your EC2 instance.

⚙️ Configure Ubuntu Server

Update the package list to ensure you get the latest version of available packages:

sudo apt update

🛠️ Install Node.js and NPM

  1. To install node.js, run the following command:

    sudo apt install nodejs
  2. To install npm, run the following command:

    sudo apt install npm
  3. The popup may display a message indicating that Daemons using outdated libraries; simply press the enter key or click on OK button.

    Daemons using outdated libraries

    Photo Credit to CodeToFun

  4. Run the following command to check the installed version of node.js and npm.

    sudo node -v
    sudo npm -v
    Verifying nodejs npm version
  5. It should be highlighted that the current version of Node.js is v20.10.0, whereas the installed version, v12.22.9, is considerably outdated.

    To upgrade the Node.js version, execute the subsequent commands individually and accurately.

    sudo npm install -g n  
    sudo n 20.10.0
    upgraded nodejs version

    Ensure you review the most recent version of Node.js on the official website.

🎉 Conclusion

Congratulations! You've successfully set up Node.js and NPM on your AWS Ubuntu EC2 instance.

You can now proceed to deploy and host your Node.js applications. Remember to configure security groups and take necessary precautions for production deployments.

👨‍💻 Join our Community:

To get interesting news and instant updates on Front-End, Back-End, CMS and other Frameworks. Please Join the Telegram Channel:

Author

author
👋 Hey, I'm Mari Selvan

For over eight years, I worked as a full-stack web developer. Now, I have chosen my profession as a full-time blogger at codetofun.com.

Buy me a coffee to make codetofun.com free for everyone.

Buy me a Coffee

Share Your Findings to All

Subscribe
Notify of
guest
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Mari Selvan
Mari Selvan
9 months ago

If you have any doubts regarding this article (Setting Up Node.js and NPM on AWS Ubuntu EC2), please comment here. I will help you immediately.

We make use of cookies to improve our user experience. By using this website, you agree with our Cookies Policy
AgreeCookie Policy