+254725682556 +254725052660 info@ziprof.co.ke
Client Area

Hosting

How to Set Up a Node.js Application on Your Hosting Account

Many hosting accounts include a built-in tool for running Node.js applications, so you don't need a separate VPS just to host a small Node app alongside your website. The control panel creates an isolated environment for your app, handles the underlying process manager, and gives you a simple interface to start, stop, and restart it.

Before You Start

Make sure you have the following ready before opening the Node.js tool:

  • Your application's files uploaded to your hosting account (via File Manager or FTP), ideally outside your main public web folder.
  • A package.json file listing your app's dependencies.
  • The name of your app's startup file (commonly app.js, server.js, or index.js).
Shared hosting is meant for lightweight Node apps (small APIs, background scripts, simple web apps), not resource-heavy or long-running production workloads. If your app needs significant CPU or memory, consider a VPS instead.

In cPanel

  1. Log in to cPanel and, under the Software section, click Setup Node.js App.
  2. Click Create Application.
  3. Choose the Node.js version you want to use from the dropdown.
  4. Set Application mode to Production (or Development, if you're still testing).
  5. Set the Application root to the folder where you uploaded your app files.
  6. If the app needs to be reachable at a URL, set the Application URL. Leave this blank if it only runs background tasks.
  7. Enter your Application startup file (e.g. app.js).
  8. Click Create.
  9. Once created, click Run NPM Install to install your dependencies from package.json.
  10. Add any required environment variables in the same screen, then click Restart to apply them.

In DirectAdmin

  1. Log in to DirectAdmin and look for Node.js Selector under the Advanced Features or Extra Features section.
  2. Click Create Application (or the equivalent add/new button).
  3. Select the Node.js version you want to run.
  4. Set the Application root to the folder containing your app files, and the Application URL if the app should be publicly reachable.
  5. Enter the Startup file name (e.g. server.js).
  6. Save the application, then use the provided Run NPM Install option to install dependencies.
  7. Set any environment variables the app needs, and restart the application for changes to take effect.

Common Issues

  • App shows old code after an update: the process doesn't reload automatically. Go back into the Node.js tool and click Restart after uploading changes.
  • "Application failed to start" error: double-check that the startup file name matches exactly what's in your app folder, and that package.json lists a valid main entry.
  • Dependencies missing: re-run Run NPM Install any time you add a new package to package.json.

If your app is unresponsive or slow, check how much CPU and memory it's using: see How to Check Your Website's CPU and Memory (Resource) Usage.