cPanel includes a Setup Node.js App tool that lets you run Node.js applications on your hosting account without needing a VPS or root access. It manages Node.js versions, installs npm packages, and handles the application process lifecycle.
Open Setup Node.js App
- Log in at https://tpc-hosting.com/login and open cPanel.
- Under Software, click Setup Node.js App.
- Click Create Application.
Configure the application
- Node.js version: Select the version your application requires. Available versions are listed in the dropdown.
- Application mode: Choose Production for live apps or Development for testing.
- Application root: The directory where your Node.js app files are located (e.g., myapp — relative to your home directory). Create this folder first via File Manager if it does not exist.
- Application URL: Select the domain and optional path that will serve your app (e.g., yourdomain.com or yourdomain.com/app).
- Application startup file: The main entry point of your app (e.g., app.js or server.js).
- Click Create.
Upload your application files
- Upload your Node.js application files to the application root directory via File Manager or FTP.
- Make sure your package.json is in the application root.
Install npm dependencies
- In the Node.js App list, find your application and click Open application root in the terminal panel, or click the npm install button displayed in the application settings.
- Alternatively, SSH into your account (see: How to Connect to Your Hosting Account via SSH) and run:
cd ~/myapp npm install
Start, stop, and restart the application
- In the Node.js App list, each app has Start, Stop, and Restart buttons.
- Click Restart after updating your application files or environment variables to apply changes.
Environment variables
- In the application settings, scroll to Environment Variables.
- Add key-value pairs for your app's configuration (database URL, API keys, port, etc.).
- Click Save and restart the application.
Troubleshooting
- App not loading: Check that the startup file name matches exactly what you entered. Verify there are no npm dependency errors by checking logs via SSH (cat ~/myapp/logs/error.log or similar).
- Port conflicts: Do not specify a port in your app code — cPanel handles routing automatically via Passenger. Remove any app.listen(PORT) calls that hardcode a port number, or use the PORT environment variable provided by Passenger.