How to install Node.js on Ubuntu 22.04?
Last updated
Node.js is a JavaScript general-purpose programming framework that allows users to easily develop network applications. It is an open-source server and makes development more consistent and integrated by employing JavaScript on both the front and backend.
This tutorial will show you how to install Node.js on Ubuntu 22.04.
There are certain prerequisites that need to be met before you begin.
Server with Ubuntu 22.04
Non-root user (sudo-enabled)
Red Color: Input
Green Color: Output
When using sudo to execute a command, you might be asked for your user password.
When a command is executed, you could be asked if you wish to carry it out further or not. Enter "Y" to proceed or "n" to end, and then press ENTER.
Step 1: Update all dependencies
i. Run the below command to fetch the package information from all configured sources.

Step 2: Download installation package
Run the below command to download and install the package fetched above.

Step 3: Install Node.js
Use the following command to install Node.js to your server.

Step 4: Check Node.js version
Once you’ve installed Node.js, now you can check the Node.js version with the below command:

Step 5: Install Node Package Manager
Use the command shown below to install npm (Node Package Manager) to install Node.js-compatible modules and packages:


Now, Node.js and npm have now been successfully installed.
Please watch the video for instructions on how to execute the above-mentioned command.
Last updated
sudo apt-get updatesudo apt-get upgradesudo apt install nodejsnode --versionsudo apt install npm