Member-only story

How to Install Node.js on Ubuntu: Three Easy Methods for 2024 Explained

Khushi Mistry
3 min readAug 22, 2024

The image is a modern, clean illustration of the Node.js logo. It features a green hexagon with the word “Node.js” written inside it. The background is simple, with a gradient that complements the green color of the logo, making it stand out prominently

Node.js is a powerful JavaScript runtime that allows you to run JavaScript code outside of a web browser, making it perfect for building scalable server-side applications. In this guide, we’ll show you three different methods to install Node.js on Ubuntu, so you can choose the one that best fits your needs.

Method 1: Installing Node.js Using apt (Default Method)

This method installs Node.js directly from Ubuntu’s default repositories. While this is the simplest way to get Node.js up and running, be aware that it might install an older version.

1. Update your package list to ensure you have the latest information on available packages:

sudo apt update

2. Install Node.js from the default Ubuntu repositories:

sudo apt install nodejs

3. Install npm (the Node.js package manager):

sudo apt install npm

4. Verify the installation by checking the version of Node.js and npm:

node -v
npm --version

Note: If you require a specific or newer version of Node.js, consider using the other methods described below.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Khushi Mistry
Khushi Mistry

Written by Khushi Mistry

DevOps Engineer | Cloud Enthusiast | Tech Blogger

No responses yet

Write a response