High Performance Starts Here — AMD Dedicated Servers

English

Home

Blog

How to Install NodeJS (any version) on U...

How to Install NodeJS (any version) on Ubuntu 22.04 Server

How to Install NodeJS (any version) on Ubuntu 22.04 Server

NetShop ISP

NetShop ISP · Blog Author

Jan 3, 2024 · Technical Tutorials

In two previous articles we demonstrated how to install nodejs on Debian 11 and also the steps to install Nodejs on a cPanel server.

As the Ubuntu 22.04 is LTS (long-term support release) more and more developers and sysadmins use it for hosting NodeJS applications. In this article we will show the steps to install any version of NodeJS on Ubuntu 22.04 server.

NodeJS Release Versions

Node.js versions enter Current release status for six months, which gives library authors time to add support for them. Here is the release schedule as per Nodejs official website.

NodeJS Release Schedule

In the following table you can check the latest release of each version branch. This is useful in cases you wish to use a stable yet not latest release version of NodeJS on your server.

NodeJS Stable Release per Branch Table

Steps to Install specific NodeJS version on Ubuntu 22.04 Server

The following steps are provided for installing NodeJS v18. You can use the same steps to install any other version, just by adjusting Step 3.

All commands below assume you are logged in to the server with root account. If you are using any other sudo privileged account, then prepend ‘sudo’ in all commands.

Step 1: Update & Upgrade System

Update your Ubuntu 22.04 system by running the following command:

root@netshopisp-nodejs:~$ apt update -y && apt upgrade -y

During the upgrade execution, you will be prompted with a window informing you about the kernel upgrade as shown below. Press “OK” to continue.

Ubuntu 22.04 Kernel Update Prompt Window

Then, you will be prompted to choose the daemon services to be restarted. You can stick to the default selected ones and press “OK” to continue.

Ubuntu 22.04 Upgrade – Daemons Restart Confirmation Window

Step 2: Reboot System

As the system’s kernel got updated, a reboot is necessary. Execute the following command to restart your server.

root@netshopisp-nodejs:~$ reboot

Step 3: Install specific NodeJS version from NodeSource

The NodeSource repository provides up-to-date releases of Node.js to ensure easy access to the latest features, bug fixes, and security updates related to Node.js.

The following command will pull the NodeSource repository for NodeJS v18 and NPM v10:

root@netshopisp-nodejs:~$ curl -fsSL https://deb.nodesource.com/setup_18.x | -E bash -

Sample Output:

NodeSource Repository Add Sample Output

Step 4: Install NodeJS v18

Now you are ready run the following command to install NodeJS v18 on the server:

root@netshopisp-nodejs:~$ apt-get install nodejs -y

Sample Output:

NodeJS v18 installation Sample Output

You have successfully installed NodeJS v18 on Ubuntu 22.04 Server. You can verify the nodejs and npm versions using the following commands:

root@netshopisp-nodejs:~$ node -v && npm -v

You can now proceed with configuring your NodeJS application on the server!

how to
nodejs
tutorials
ubuntu
Press Releases
97
Industries
122

Free VPS Trial

No Credit Card Required.

Start Your VPS Hosting Free Trial

Recent Posts

Hermes AI Agent VPS - Deploy in 1 Click

Introducing Hermes Agent VPS: Your Own AI Agent, Live in One Click

22 July 2026

How To Protect Your Website from DDoS Attacks in 2026

How To Protect Your Website from DDoS Attacks in 2026

14 July 2026

Why Your Stream Keeps Buffering (And How to Fix It)

Why Your Stream Keeps Buffering (And How to Fix It)

08 July 2026

How to Secure Your WordPress Website in 2026

How to Secure Your WordPress Website in 2026

30 June 2026

How To Fix Outdated Theme on cPanel / WHM

Why Your cPanel or WHM Login Page Is Showing an Outdated Theme (And How to Fix It)

22 June 2026