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.jsonfile listing your app's dependencies. - The name of your app's startup file (commonly
app.js,server.js, orindex.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
- Log in to cPanel and, under the Software section, click Setup Node.js App.
- Click Create Application.
- Choose the Node.js version you want to use from the dropdown.
- Set Application mode to Production (or Development, if you're still testing).
- Set the Application root to the folder where you uploaded your app files.
- If the app needs to be reachable at a URL, set the Application URL. Leave this blank if it only runs background tasks.
- Enter your Application startup file (e.g.
app.js). - Click Create.
- Once created, click Run NPM Install to install your dependencies from
package.json. - Add any required environment variables in the same screen, then click Restart to apply them.
In DirectAdmin
- Log in to DirectAdmin and look for Node.js Selector under the Advanced Features or Extra Features section.
- Click Create Application (or the equivalent add/new button).
- Select the Node.js version you want to run.
- Set the Application root to the folder containing your app files, and the Application URL if the app should be publicly reachable.
- Enter the Startup file name (e.g.
server.js). - Save the application, then use the provided Run NPM Install option to install dependencies.
- 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.jsonlists a validmainentry. - 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.