Install NodeJS in AlmaLinux

Question:

How to install nodejs in AlmaLinux 8?

Applicable to:

  • VPS Linux
  • Dedicated Server Linux.
  • EVC Linux

Answer:

Update to the latest first.

dnf update
dnf install epel-release

List available versions:

# dnf module list nodejs
Last metadata expiration check: 1:37:30 ago on Wed 05 Aug 2026 10:00:05 AM WIB.
AlmaLinux 8 - AppStream
Name Stream Profiles Summary
nodejs 10 [d] common [d], development, minimal, s2i Javascript runtime
nodejs 12 common [d], development, minimal, s2i Javascript runtime
nodejs 14 common [d], development, minimal, s2i Javascript runtime
nodejs 16 common [d], development, minimal, s2i Javascript runtime
nodejs 18 common [d], development, minimal, s2i Javascript runtime
nodejs 20 common [d], development, minimal, s2i Javascript runtime
nodejs 22 common, development, minimal, s2i Javascript runtime
nodejs 24 common, development, minimal, s2i Javascript runtime

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

Let's install version 20 which is stable.

# dnf module install nodejs:20
Last metadata expiration check: 1:39:48 ago on Wed 05 Aug 2026 10:00:05 AM WIB.
Dependencies resolved.
========================================================================================================================
Package Architecture Version Repository Size
========================================================================================================================
Installing group/module packages:
nodejs x86_64 1:20.20.2-1.module_el8.10.0+4165+3f200bda appstream 15 M
npm x86_64 1:10.8.2-1.20.20.2.1.module_el8.10.0+4165+3f200bda appstream 2.0 M
Installing weak dependencies:
nodejs-docs noarch 1:20.20.2-1.module_el8.10.0+4165+3f200bda appstream 11 M
nodejs-full-i18n x86_64 1:20.20.2-1.module_el8.10.0+4165+3f200bda appstream 8.6 M
Installing module profiles:
nodejs/common
Enabling module streams:
nodejs 20

Transaction Summary
========================================================================================================================
Install 4 Packages

Total download size: 36 M
Installed size: 182 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): nodejs-20.20.2-1.module_el8.10.0+4165+3f200bda.x86_64.rpm 13 MB/s | 15 MB 00:01
(2/4): nodejs-docs-20.20.2-1.module_el8.10.0+4165+3f200bda.noarch.rpm 8.9 MB/s | 11 MB 00:01
(3/4): npm-10.8.2-1.20.20.2.1.module_el8.10.0+4165+3f200bda.x86_64.rpm 8.1 MB/s | 2.0 MB 00:00
(4/4): nodejs-full-i18n-20.20.2-1.module_el8.10.0+4165+3f200bda.x86_64.rpm 4.9 MB/s | 8.6 MB 00:01
------------------------------------------------------------------------------------------------------------------------
Total 20 MB/s | 36 MB 00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : nodejs-docs-1:20.20.2-1.module_el8.10.0+4165+3f200bda.noarch 1/4
Installing : nodejs-full-i18n-1:20.20.2-1.module_el8.10.0+4165+3f200bda.x86_64 2/4
Installing : npm-1:10.8.2-1.20.20.2.1.module_el8.10.0+4165+3f200bda.x86_64 3/4
Installing : nodejs-1:20.20.2-1.module_el8.10.0+4165+3f200bda.x86_64 4/4
Running scriptlet: nodejs-1:20.20.2-1.module_el8.10.0+4165+3f200bda.x86_64 4/4
Verifying : nodejs-1:20.20.2-1.module_el8.10.0+4165+3f200bda.x86_64 1/4
Verifying : nodejs-docs-1:20.20.2-1.module_el8.10.0+4165+3f200bda.noarch 2/4
Verifying : nodejs-full-i18n-1:20.20.2-1.module_el8.10.0+4165+3f200bda.x86_64 3/4
Verifying : npm-1:10.8.2-1.20.20.2.1.module_el8.10.0+4165+3f200bda.x86_64 4/4

Installed:
nodejs-1:20.20.2-1.module_el8.10.0+4165+3f200bda.x86_64
nodejs-docs-1:20.20.2-1.module_el8.10.0+4165+3f200bda.noarch
nodejs-full-i18n-1:20.20.2-1.module_el8.10.0+4165+3f200bda.x86_64
npm-1:10.8.2-1.20.20.2.1.module_el8.10.0+4165+3f200bda.x86_64

Complete!

Now lets verify.

# npm -v
10.8.2
# node -v
v20.20.2

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.