Guide to Node.js™ Installations


Last modified: April 24, 2024

Overview

Node.js™ is an open-source server environment that runs JavaScript. It does not use threads and does not block processes. Because of this, it provides efficient resource management.

For more information about Node.js, visit the Node.js website.

Requirements

Before you can install Node.js, your system must meet the following requirements:

  • You must possess root-level access to the server.
  • Your server’s package manager must function properly. For more information about package managers, read our Package Manager Basics documentation.

Install Node.js

Installing Node.js on servers running RHEL-derived operating systems

You can install Node.js on all supported Red Hat® Enterprise License® (RHEL)-based operating systems with one of the following methods:

  • In the interface, install the Node.js package in the Additional Packages section of WHM’s EasyApache 4 interface (WHM » Home » Software » EasyApache 4).
  • On the command line, use your package manager to install one of the following packages:
    • ea-nodejs16
      Note:
      If your system runs CentOS 7, you can only install the ea-nodejs16 package.
    • ea-nodejs18
    • ea-nodejs20

Installing Node.js on servers running Ubuntu

To install Node.js on Ubuntu® operating systems run the following commands, where 20.x represents the Node.js version that you want to install:

1
2
3
4
curl -s https://deb.nodesource.com/setup_20.x | sudo bash
apt install nodejs npm
apt install ea-apache24-mod-passenger
ls -al /etc/cpanel/ea4/passenger*.system-default

Install a Node.js application

cPanel users can install Node.js web applications in one of the following ways:

  • Clone an existing application in cPanel’s Git Version Control interface (cPanel » Home » Files » Git Version Control).

  • Create a new application.

The Node.js Foundation provides a list of Node.js applications. This list is not comprehensive.

Uninstall Node.js

You can uninstall Node.js from a server running an RHEL-derived operating system with one of the following methods:

  • In the interface, uninstall the Node.js package in the Additional Packages section of WHM’s EasyApache 4 interface (WHM » Home » Software » EasyApache 4).

  • On the command line, use your package manager to uninstall your NodeJS package.

To uninstall Node.js from an Ubuntu server, run the following command:

apt-get purge --auto-remove nodejs

Troubleshoot Node.js

If you experience issues with your Node.js installation, use Phusion Passenger’s™ Troubleshooting Passenger Standalone and Node.js documentation to troubleshoot the issue.

If you experience issues with the port on which your Node.js applications listens, use Phusion Passenger’s™ Reverse port binding in Node.js documentation to troubleshoot the issue.

Included applications

When you install Node.js, the package includes the following applications:

  • Node.js
  • NPM — A Node process manager.
  • NPX — A Node process runner.

The system stores these applications in the /opt/cpanel/ea-nodejs16/bin/ directory.

Additional Documentation