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.
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 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?
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
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
- First Step to Login cPanel Account
- Under the software section of cPanel – Click the ‘Setup Node.js App’ icon to open the Node js section
- Click Create Application button to start the node js mode and set up the node js website application directory.
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.
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.
- After the Node js website application created in Cpanel,
- At this time for NPM installation, you will need and required to package.json file
- 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.
“description”: “My App”,
“test”: “echo \”Error: no test specified\” && exit 1″
Step to Install NPM
In bellow image show to run Node js NPM
- In the cPanel SOFTWARE section, click on the Setup Node.js website App icon to open the Node.js application.
- After that, you will be able to create to Stop/Restart/Edit/Remove the application.
- In the Actions column of the Web Applications list, click to edit the application.
- To running NPM install command, click the Run NPM Install button.
- The NPM installation success indicator when complete.
And now you have successfully host node.js website application in Cpanel.