Search code examples
node.jscpanelshared-hosting

How to install node js App in CPanel/Shared Hosting


I wanted to host my Node js application using CPanel with shared hosting. Can you please help me with it.


Solution

  • There are few steps to host your Node.js App using Cpanel.

    1. Login to your CPanel Account

    2. Go to Software Tab and Select "SetUp Node.js App" Select Setup Node.js App

    3. Click Create Application Button enter image description here

    4. Fill Application root, Application URL and Application Startup File and Click Create Button enter image description here

    5. Go to file Manager and Create package.json file in the app file directory. and add this

      { "name": "Node App", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo "Error: no test specified" && exit 1" }, "author": "", "license": "ISC" }

    6. Go to Setup Node.js App and select Edit icon to run npm install enter image description here enter image description here it may take time to show Run Npm button

    7. You are all done and run your Node.js app