This guide explains how to set up and run Node.js applications on your HOSTDOG hosting. You will learn how to create a Node.js application through the control panel, configure the entry point, install dependencies, and manage your application.
What you will need
- An active HOSTDOG hosting account
- Access to your hosting control panel (how to log in)
- A Node.js application ready to deploy (with a
package.jsonfile) - SSH access (optional, for command-line management)
Set up a Node.js application
Log in to your control panel and find the Software section. Click Setup Node.js App. This tool manages Node.js applications on your hosting account.
Click Create Application and configure the following settings:
| Setting | Description |
|---|---|
| Node.js version | Select the version your application requires (e.g., 18, 20, 22) |
| Application mode | Set to Production for live sites, Development for testing |
| Application root | The directory containing your app files (e.g., /home/yourusername/myapp) |
| Application URL | The domain or subdomain that serves the app |
| Application startup file | The entry point (e.g., app.js, server.js, index.js) |
Upload your Node.js application to the application root directory using FTP/SFTP, File Manager, or Git. Make sure your package.json is in the application root.
In the Node.js app management page, click Run NPM Install to install the packages defined in your package.json. Alternatively, connect via SSH, navigate to the app directory, and run:
cd ~/myapp
source /home/yourusername/nodevenv/myapp/18/bin/activate
npm install
source ... activate command activates the virtual environment for your Node.js application. The exact path depends on your app root and Node.js version. The control panel displays the correct activation command on the app management page.
Click Start App (or Restart if it is already running). The control panel provisions a Passenger process that keeps your application running and routes incoming requests to it. Visit your domain to verify the app is working.
Managing your Node.js application
From the Node.js app management page, you can:
- Stop and Restart the application
- Change the Node.js version (select a different version from the dropdown and save)
- Set environment variables — add key-value pairs that your app can access via
process.env - Run NPM Install again after updating
package.json - Delete the application when no longer needed
app.listen(port), Passenger overrides it automatically.
Troubleshooting
Check the application's error log in the stderr.log file inside your application root directory. Common causes include missing dependencies (run NPM Install), incorrect startup file path, or syntax errors in your code. Also ensure the Node.js version matches your application's requirements.
Connect via SSH, activate the Node.js environment, and run npm install manually to see the full error output. Common issues include outdated lock files (package-lock.json) — try deleting it and the node_modules directory, then running npm install again. If a package requires a newer Node.js version, update the version in the app settings.
If code changes do not appear after a restart, create or update the tmp/restart.txt file in your application root: touch tmp/restart.txt. Passenger watches this file and restarts the app when it detects a change. You can also try stopping the app, waiting a few seconds, and starting it again from the control panel.