Overview
Now that Plesk Onyx and Obsidian natively support Node.js, you can run your applications without any manual changes or hacks to your existing systems. This includes services such as Express, Next.js, Meteor and derivatives which require some server side JavaScript rendering.
Supported versions of node will vary based on the underlying operating system, please contact Conetix to confirm the available versions for your system.
The instructions below will step you through the process of deploying and configuration the application.
Prerequisites
- Own VPS with Plesk installed
- Plesk root or administrator Login
- Node.js Plesk Extension installed
Instructions
- Login to Plesk.
- Select the domain you wish to run your Node.js, then select Node.js:
- Enter the details about the app:
This needs to include:
1. Document Root (location of the static assets to be served by the app)
2. Application Root (the location of your app files, eg what contains the app.js and libraries)
3. The application startup file (typically app.js, server.js or similar)
4. Any Custom environment variables required to run the app (if any) - After you’ve received confirmation that the Startup File exists, you then need to enable Node.js:
Diagnosing issues
If your application fails to start or it’s having an issue, you can enable the debug mode to get further details.
- Within the Node.js area, set the Application Mode to development:
- If your application fails to start, you should now see a larger error message with further information:
- If the brief message isn’t sufficient to diagnose, click on Detailed diagnostics to get a detailed view of what’s going on.
Startup Files
Some Node.js will need a separate startup file. For example, if you run Frontity, you can create a startup file similar to:
var frontity = require("./server").default;
var http = require(‘http’);
var server = http.createServer(frontity);
server.listen(process.env.PORT);
This will need to be saved to a file, eg startapp.js and set as the Application Startup File in the Plesk Node.js configuration.