Node.JS Apps lets you run Node.js applications (Express, Next.js, Nuxt, APIs and so on) on your domains. The panel starts and stops the app, keeps it running and connects it to a domain or subdomain.
Where to find it: Domains → Node.JS Apps.
Note: Your hosting provider must install the CWP Node.js engine, install at least one Node.js version and enable the feature for your account. If you see Node Js not available, please contact admin for more information, ask your provider.
Create an application
- Upload your application files to a folder in your account, for example
/home/youraccount/myapp, with the File Manager, FTP or Git Manager. - Click New application.
- Fill in General settings:
| Field | What to enter |
|---|---|
| NodeJS Version | The Node.js version your app needs |
| Descriptive name | A name to recognise the app, for example Company API |
| Application mode | Production or Development — sets the NODE_ENV variable |
| Path | The folder that contains your app (and its package.json) |
| Startup file | The file that starts the app, for example app.js, server.js or index.js |
| Port | The port your app listens on. It is passed to the app as the PORT environment variable — use process.env.PORT in your code. |
| URI | The domain or subdomain (and optional path) where the app is published, for example https://api.example.com |
| Environment variables | Extra settings as KEY / Value pairs, for example DATABASE_URL. Click Add environment variable for more. |
- Click Save.
- Click NPM install to install the dependencies from
package.json. Wait for NPM Install completed! - Click Start.
Open the URI in your browser to check the app.
Manage applications
The Applications list shows each app with its name, version, path, status and mode. Use the buttons to Start, Stop, Restart, Edit, View log or Delete an application. Restart the app after you upload new code or change environment variables.
The box at the top shows how many applications your package allows.
Common problems
| Problem | Solution |
|---|---|
| Application cannot start | Open View log. Common causes: missing dependencies (run NPM install), wrong Startup file, or a syntax error in the code. |
| The app starts but the URI shows an error (502/503) | The app is not listening on the configured port. Use process.env.PORT in your code and restart. |
| Startup file does not exist! | Check the Path and the file name (names are case-sensitive). |
| Changes do not appear | Restart the application after every code change. |
| Quota exceeded | You reached the number of Node.js apps your package allows. |