Question
How can I install NodeJS and utilize it for my web application?
Procedure
The Application Manager in cPanel allows users to deploy Phusion Passenger applications, including NodeJS apps. To install NodeJS on your system, you'll need to install the supporting packages.
Installing via the command-line
- Determine the version of NodeJS you'd like to install based on your operating system.
- Access the command line as root and run the following command, replacing the ea-nodejs package with the version determined in step 1
# on CentOS 7
yum install ea-apache24-mod_env ea-ruby27-mod_passenger ea-nodejs18
# on AlmaLinux / Rocky Linux 8
yum install ea-apache24-mod_env ea-apache24-mod-passenger ea-nodejs18
# on AlmaLinux / Rocky Linux 9
yum install ea-apache24-mod_env ea-apache24-mod-passenger ea-nodejs18
# on Ubuntu based systems
apt install ea-apache24-mod-env ea-apache24-mod-passenger ea-nodejs18 - Verify that it has been installed correctly with the following command:
/opt/cpanel/ea-nodejs16/bin/node -v
Installing via the WHM interface
- Navigate to "WHM / Software / EasyApache 4" and click customize:
- Click the "Apache Modules" section, then ensure mod_env and mod_passenger are enabled:
- Next, navigate to the "Additional Packages" section and select a version of NodeJS to install. Only one version can be installed at a time via EasyApache.
- Click "Review" then "Provision" once you've reviewed the packages queued for installation.
Resources
Once NodeJS is installed, you'll need to set up your individual applications in cPanel.
How to Install a Node.js Application | cPanel Docs
Please note NodeJS is a back-end JavaScript runtime environment. cPanel Support is limited to ensuring the basic functionality of the provided runtime components and cannot directly provide assistance with application code. It's recommended to reach out to a developer for further guidance or refer to NodeJS' official documentation: