Node.js is a free, and open-source JavaScript runtime built on Chrome’s V8 JavaScript engine used to build scalable network applications. Generally, it is used on the back-end, but you can also use it as a full-stack and front-end solution. It is cross-platform, lightweight, and supports a non-blocking I/O model and event-driven architecture. Node.js allows you to develop complex and very scalable web applications easily.

In this post, we will show you how to install Node.js and NPM on RockyLinux 10.

Step 1 – Install Nodejs Using NodeSource Repository

By default, the latest version of Node.js is not available in the RockyLinux 10 default repo, so you can use the NodeSource repository to install the latest version of Node.js.

First, install the curl command utility using the following command:

dnf install curl -y

Next, add the NodeSource repository with the following command:

curl --silent --location https://rpm.nodesource.com/setup_22.x | bash -

Next, install the latest Node.js version with the following command:

dnf install nodejs

After the installation, verify the Node.js version with the following command:

node -v

You should see the following output:

v22.20.0

To verify the NPM version, run the following command:

npm -v

You should see the following output:

11.6.2

Step 2 – Install Nodejs Using NVM

You can also install Node.js using the Node Version Manager (NVM). NVM provides an easy way to install and manage multiple Node.js versions in the same system.

First, install NVM using the following command:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash

This will install NVM on your system and add the NVM path to the .bashrc file.

Next, activate the NVM system path using the following command:

source ~/.bashrc

To verify the NVM version, run:

nvm --version

You should see the following output:

0.40.3

To install the latest Node.js version, run:

nvm install node

You should see the following output:

Downloading and installing node v25.0.0...
Downloading https://nodejs.org/dist/v25.0.0/node-v25.0.0-linux-x64.tar.xz...
################################################################################################################################################################################# 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v25.0.0 (npm v11.6.2)
Creating default alias: default -> node (-> v25.0.0)

To install the latest stable Node.js version, run:

nvm install --lts

You should see the following output:

Installing latest LTS version.
Downloading and installing node v22.20.0...
Downloading https://nodejs.org/dist/v22.20.0/node-v22.20.0-linux-x64.tar.xz...
################################################################################################################################################################################# 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v22.20.0 (npm v10.9.3)

To list all Node.js versions installed in your system, run:

nvm ls

You should see the following output:

 v22.20.0
-> v25.0.0
v21.6.0
system
default -> 20.2.0 (-> v20.2.0)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v21.6.0) (default)
stable -> 21.6 (-> v21.6.0) (default)
lts/* -> lts/iron (-> v20.11.0)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.12 (-> N/A)
lts/fermium -> v14.21.3 (-> N/A)
lts/gallium -> v16.20.2 (-> N/A)
lts/hydrogen -> v18.19.0 (-> N/A)
lts/iron -> v20.11.0
To set the default Node.js version, run:
nvm use 25.0.0

You should see the following output:

Now using node v25.0.0 (npm v11.6.2)

Conclusion

In the above guide, we explained three different ways to install Node.js and NPM on Rocky Linux 10. You can now install your required Node.js version using any of the above methods. Give it a try on your dedicated server from Atlantic.Net!