Software Installs

How to Install Node.js on a cPanel VPS

Editor’s Note: As third-party software, ServInt does not support node.js beyond installation. Also, to follow these instructions, users must have a working knowledge of the command line. Click here if you would like more information about logging into your server on the command line.

Node.js is an application development software written in and for javascript for real-time event-driven applications, among other things. Installing node.js on a cPanel VPS is pretty straightforward. Let’s take a look.

The first thing that you will need to do is download the latest version from


Before proceeding further, you will need to make sure that you meet the following requirements listed in the README file:

  1. GCC 4.2 or newer
  2. Python 2.6 or 2.7
  3. GNU Make 3.81 or newer

Update any software in the above list that is not up to date.

Once you make sure that you’ve met all of the requirements, unpack the node.js tarball and install it:

tar -xzvf node-v0.10.32.tar.gz
mv node-v0.10.32.tar.gz node
cd node
make && make install

Node.js is now installed. To test and make sure that it is working, you can create a basic server as a proof of concept. First, create a directory to store the apps in, you can call it “server”. Make the ownership all the same:

mkdir server
chown -R account:account /home/account/node
What's the difference between our Cloud VPS and our “Traditional” VPS? Find out more.

Then with your text editor of preference — I’m using vim in this example — create the file server.js. I used the code from the site since I am not proficient with javascript:

vim server/server.js
var http = require("http");
http.createServer(function(request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello World");

Open the port in your firewall and then start things:

vim /etc/csf/csf.conf

Add the port, 8080, to the list of open ports

csf -r
/usr/local/bin/node server/server.js
[ctrl d]

To test to see if it is working, go to port 8080 at your server’s main IP address: You should get a message in your browser that says “Hello World”. If so, you have just confirmed that node.js is installed correctly.

Now we need to direct traffic for our domain to the node.js build. This can be done via the .htaccess file. Place the below lines into an .htaccess file in the public_html directory

RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.domain\.com$
RewriteRule ^(.*) "http\:\/\/127\.0\.0\.1\:8080\/$1" [P,L]

Your domain name replaces “domain” in the above example. When you visit your domain you should now see your node.js site.

Photo by Node.js

  • Hosting Advice
  • Computer World
  • Ars Technica

  • The New York Times
  • The Seattle Times
  • Bloomberg
  • The Hill

To engage with the ServInt Sales Team use the following chat icon. Normal sales hours are Monday-Friday 9am-5pm EST but feel free to leave a message and we will follow up as soon as possible.

Sales Chat

To engage with the ServInt Support Team you must be logged into our Customer Portal for identity verification and have a ticket opened about your request or there will only be limited support offered.

Support Chat