How to install Node.js on CentOS 8

Node.js is an open-sourced Javascript platform that allows users the ability to quickly build network applications in a scalable manner. Node.js lets users employ JavaScript for server-side scripting. For the purpose of this article, we will be installing Node.js on a CentOS machine using a personal package archive (PPA). PPA will have more current versions of node.js available than are available in the standard CentOS repository, and you can also explicitly select between Node.js versions to suit your needs.


To follow this guide, you’ll need access to the following:

  • A non-root user on your server that has sudo privileges enabled (if you’re following best practices, root logins to your Linux servers should be disabled)

Installing PPA and Node.js

Step 1

Let’s start by making sure that the CentOS package installer, yum, has the most up-to-date information:

sudo yum check-update
sudo yum install

Step 2

Next, install the curl tool if it is not already included with your system packages, then use it to download and install PPA. Notice that in this example we’re requesting “setup_13.x”, which means version 13.x is specifically being requested. You can replace “13.x” with any other desired version in the following commands:

sudo curl -sL | bash -

Step 3 (Optional)

If you need to compile and install native addons from npm, be sure to install build tools:

yum install gcc-c++ make
# or: yum groupinstall 'Development Tools'


Now that we have installed Node.js, we can move on to building a web server and start making applications. To see more specific information about PPA versions available for Node.js installations done this way, check out the NodeSource documentation page.

Leave a Reply

Your email address will not be published. Required fields are marked *