Question
How do you use NodeJS on Ubuntu with cPanel?
Answer
Ubuntu supports multiple versions of NodeJS. You should first determine the version you'd like to install:
What version of NodeJS does cPanel offer?
You can install NodeJS via EasyApache 4 or via the command line.
EasyApache 4
- Log in to WHM as the
rootuser - Navigate to Home / Software / EasyApache 4
- To the right of Currently Installed Packages, click on the blue Customize button
- Click on the Additional Packages tab
- Select the desired nodejs# package you wish to install
- Click the Next button
- Review the provided details on what packages are going to be installed and removed (if any)
- If the packages that are set to be installed and removed (if any) are okay, click the Provision button
Command line
- Log in to the server via SSH or WHM's Terminal as the
rootuser. -
Use
aptto install the needed packages:# apt install ea-apache24-mod-env ea-apache24-mod-passenger $ea-nodejs#
Note: You need to replace "$ea-nodejs#" with the nodejs version you want to install, such as ea-nodejs18
-
Verify that NodeJS has been installed correctly:
# /opt/cpanel/$nodeversion/bin/node -v
Once NodeJS is installed, you'll need to add your Node application to the Application Manager in cPanel:
How to Install a Node.JS application | cPanel & WHM Documentation
Comments
0 comments
Article is closed for comments.