SakuraHost's shared and reseller hosting (including the Alpha platform) runs Node.js apps through cPanel's "Setup Node.js App" tool, which uses Apache + Passenger behind the scenes — not PM2 and not a systemd service. That's a VPS-only workflow; see How to Deploy a Node.js Application on Your VPS with PM2 if you have a VPS instead. This guide covers shared/reseller (cPanel) hosting specifically.

The #1 cause of a broken deploy: your app has two separate "paths" that must match exactly — the Application Root you set in Setup Node.js App, and wherever your code actually ends up (your Git deploy path, or your upload folder). If they don't match, cPanel serves whatever is in the Application Root — usually nothing — and visitors see a raw folder listing instead of your site. Most support tickets about "my Node app doesn't load" come down to this one mismatch. Steps 1 and 2 below explain how to keep them in sync.

1. Register your app in cPanel

Open Setup Node.js App in cPanel (search "Node" in the top search box) and click Create Application.
Fill in:
  • Node.js version — pick the version your app was built against.
  • Application mode — Production.
  • Application root — the folder (relative to your home directory) your code will live in, e.g. app or myapp. Write this down — you'll need the identical path in Step 2.
  • Application URL — the domain/subdomain this app should answer on.
  • Application startup file — your entry point, e.g. app.js, server.js, or index.js.
Click Create. cPanel creates the folder and a virtual environment, and shows you a command to activate it (you won't normally need to run this by hand — the NPM Install button below does it for you).

2. Get your code into the Application Root

Option A: Git™ Version Control (recommended)

Open Git™ Version Control in cPanel and click Create (or Clone a Repository if you're pulling from GitHub/GitLab).

Set the Repository Path to the exact same folder as the Application Root from Step 1. If you registered the app at app but your repository path is repositories/myapp, your site will keep showing an empty folder no matter how many times you deploy — the code is landing somewhere Apache/Passenger isn't looking.

Add a .cpanel.yml file to the root of your repository to automate the deploy. DEPLOYPATH must also match your Application Root:

--- deployment: tasks: - export DEPLOYPATH=/home/USERNAME/app - /bin/cp -R * $DEPLOYPATH/ - /bin/cp -R .[!.]* $DEPLOYPATH/ 2>/dev/null || true - cd $DEPLOYPATH && /opt/cpanel/ea-nodejs20/bin/npm install --production - touch $DEPLOYPATH/tmp/restart.txt

Replace USERNAME with your cPanel username and ea-nodejs20 with the Node version you selected in Step 1 (check ls /opt/cpanel/ | grep nodejs if unsure, or ask support). Then use "Pull or Deploy" in Git Version Control to push a new update whenever you commit changes.

Option B: Manual upload

If you're not using Git, upload your files directly into the Application Root folder via File Manager or SFTP. Your package.json, source files, and (if you're not letting cPanel install them) node_modules all need to live inside that exact folder.

3. Install dependencies

Go back to Setup Node.js App, click your application, and press Run NPM Install. This runs npm install inside the correct virtual environment for you — use this instead of a bare npm install from a generic terminal, since shared hosting accounts don't always have Terminal access enabled, and even when they do, you need the app's specific Node virtualenv activated first.

4. Start (or restart) the app

Passenger watches for a specific file to know when to reload your app. Either:

touch ~/app/tmp/restart.txt

…or click the Restart button in Setup Node.js App. Your .cpanel.yml above already does this automatically on every Git deploy.

5. Verify it's actually live

Visit your domain. If you see your application, you're done. If you see a raw "Index of /" directory listing instead, work through this checklist:

Checklist:
  1. Is the app Enabled? Open Setup Node.js App and confirm the toggle is on. Accounts that have been migrated between servers sometimes come back with the app registered but disabled — this alone will produce exactly this symptom even when everything else is correct.
  2. Does the Application Root actually contain your files? Check via File Manager that package.json and your entry file are really inside the folder you registered in Step 1 — not a sibling folder, not one level up or down.
  3. Did NPM Install actually succeed? Re-run it from Setup Node.js App and read the output for errors.
  4. Did you touch restart.txt after the last deploy? Passenger caches the running process until it sees a newer restart.txt.
Need help? Contact SakuraHost Support and include your domain and cPanel username — we can check the Application Root and deploy path match directly on the server.
Was this answer helpful? 0 Users Found This Useful (0 Votes)