How to Host Node Js Website in cPanel–Complete Node jsSetup Guide

setup node.js website in cpanel

Node.js is intended to be a server-side platform built on Chrome’s JavaScript runtime (V8 JavaScript engine).

It can be built easily for the secure development of scalable web-based network applications that makes it lightweight and efficient. It utilizes cheap node js hosting event-driven & non-blocking I/O model for real-time and data-intensive applications working across several distributed devices.

Nide.js is also more efficient work with client-side JavaScript runtime application requests. It is an open-source, cross-platform runtime ecosystem for networking and developing server-side applications to install node.js on shared hosting.

Node.js runtime applications are formulated in JavaScript and run on multiple operating systems (OS) Microsoft Windows, and Linux. Worlds’ most popular and leading companies use the setup node.js app Cpanel and run node js website on server, these companies are Netflix, Walmart, PayPal, and Uber.

How to Host Nodejs Website in cPanel Shared Hosting

Most of the shared hosting service providers companies are not allowing to host Node js website in Cpanel applications on their servers and not gives SSH access for the cPanel.

  • To install the Node js website on CPanel shared hosting, we have noticed some common doubts and mistakes get website developers and owners.
  • So people are not able to run certain JavaScript application tasks for running node.js on the Cpanel hosting environment.

So In this article, we decided to write this step by step tutorial guide to install and set up the Node js website on Cpanel shared hosting. To upload Node js website on panel low cost web hosting first, we need to install NPM access.

What is cPanel?

cPanel is an online most popular Linux based graphical interface (GUI) control panel for web hosting accounts to clarify website and server management.

cPanel gives you to manage your website content, domain, create an email account and more service in a single place. Many hosting companies offer a Cpanel account to their customer when you buy hosting plans packages.

It is easy to use interface comes in two parts – User interface and server management interfaces.

What is NPM?

NPM is a package manager for Node.js, it is a default package manager for the JavaScript runtime environment Node.js. The NPM package manager program is installed on your computer when you run the Node.js application.

NPM (Node package manager) is installed on a computer when you looking at the JavaScript project. To run node js, so you need to install the lasted node and npm command line for getting started.

Using npm in a project

Node and npm packages must be installed, where you want to work on the project your project must contain a file called package.json.

The following command line by running npm inside your project. If your file does not have a package.json

cd my-awesome-project

npm init

To install Node js website on the server then, you need to have SSH access to the server.

What is SSH (Secure Shell?)

Secure Shell (SSH) is a secure protocol that offers secure, safe to a remote computer command-line access to your Shared Hosting account. A Secure Shell SSH buyer allows you to connect to a remote network running an SSH server.

The SSH access allows you to access text-mode terminal on a remote computer, you can remotely log in to your shared Cpanel hosting account and control commands as if you implied sitting directly at the server.

Step to Run and Install Node js Website Application on cPanel

You can run multiple applications instantly from node js website cPanel account. Every Node js website application can have its directory root and structure to installing on its file, folder, and database.

Creating and Host Node js Website in cPanel Account

  1. First Step to Login cPanel Account
  2. Under the software section of cPanel – Click the ‘Setup Node.js App’ icon to open the Node js sectioninstall node.js website on shared hosting
  3. Click Create Application button to start the node js mode and set up the node js website application directory.

js version:

In the Node js version to choose your lasted the drop-down version list

Change Application mode:

Select the Development mode or Production mode from the drop-down list. The available modes are Development and Production.

Specify Application root:

The system specifies for server application files that correspond with its URI.

Application URL:

the app URL is defined the fill in an HTTP/HTTPS link to the application on the Internet.

Application StartUP file:

this application StartUP file specifies the use of the NAME.js format when starting the application. When the fill complete information, click the Create button.

  1. After the Node js website application created in Cpanel,
  2. At this time for NPM installation, you will need and required to package.json file
  3. Now the Node js application is installed then follow the step to install package.json and npm in the next two sections.

Create the package.json file

  • Go to the Files section of cPanel, click the File Manager section.
  • After that, the File Manager section, click the application root folder and with +File button to create a new file- enter the file name package.json and then click the Create New File button.
  • Then check the Right button or secondary click on the package.json file and click to edit button.
  • Open the New dialog box, then copy the enter the bellow text give code and, click the save button.

{

  “name”: “app”,

  “version”: “1.0.0”,

  “description”: “My App”,

  “main”: “app.js”,

  “scripts”: {

    “test”: “echo \”Error: no test specified\” && exit 1″

  },

  “author”: “”,

  “license”: “ISC”

}

Step to Install NPM

In bellow image show to run Node js NPM

run node js website on server

  1. In the cPanel SOFTWARE section, click on the Setup Node.js website App icon to open the Node.js application.
  2. After that, you will be able to create to Stop/Restart/Edit/Remove the application.
  3. In the Actions column of the Web Applications list, click to edit the application.
  4. To running NPM install command, click the Run NPM Install button.
  5. The NPM installation success indicator when complete.

And now you have successfully host node.js website application in Cpanel.

Leave a reply

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

WhatsApp chat