Using Node.js

Enabling Node.js support

To enable Node.js support on the server, follow these steps:

Plesk for Linux

  1. Go to Tools & Settings and click Updates.
  2. Go to Add/Remove Components, expand Web hosting, and mark the “NodeJS support” component for installation.
  3. Click Continue to begin the installation.

Plesk for Windows

  1. Go to Tools & Settings and click Updates.
  2. Go to Add/Remove Components, expand Web hosting, and mark the “Node.js IIS module (iisnode)” and “Node.js” components for installation.
  3. Select the desired Node.js version under the “Node.js” component
  4. Click Continue to begin the installation.

Note

To use Node.js applications inside CageFS, install the passenger-cagefs package and follow the instructions in its README file.

Managing Node.js versions

Plesk supports the latest stable and LTS releases of Node.js, with the following limitations:

  • (Plesk for Linux) Both releases can be installed simultaneously, and Node.js applications on different domains can use any available Node.js version.
  • (Plesk for Windows) Only one Node.js version can be installed at any time, and is used to power all Node.js applications on the server.

To manage the Node.js version(s) available on the server, follow these steps:

Plesk for Linux

  1. Go to Extensions and click Node.js Manager. Here, you can see the Node.js versions installed on the server as well as the paths to their corresponding binaries.
  2. Click the image-76663.png icon next to a Node.js version to disable it. Disabling a Node.js version has the following effects:
    • The disabled Node.js version can no longer be selected when managing Node.js applications for domains.
    • Existing Node.js applications are switched to a different, enabled Node.js version (if possible).
    • If all Node.js versions on the server are disabled, all existing Node.js applications stop working, and the ability to manage Node.js applications for domains is removed until at least one Node.js version is enabled again.
  3. Click the image-76664.png icon next to a disabled Node.js version to enable it.

Plesk for Windows

  1. Go to Extensions and click Node.js Manager. Here, you can see the Node.js version installed on the server as well as the path to its binary.
  2. Click the image-76665.png icon next to the installed Node.js version to disable it. This will make all existing Node.js applications stop working, and the ability to manage Node.js applications for domains will be removed until Node.js is enabled again.
  3. Click the image-76666.png icon next to the installed Node.js version to enable it.
  4. To change the installed Node.js version, go to Tools & Settings, click Updates, go to Add/Remove Components, expand Web hosting, select the desired Node.js version under the “Node.js” component, and then click Continue.

Controlling Node.js availability to customers

Enabling Node.js support adds the following permissions to service plans and subscriptions, which you can use to regulate customers’ access to the Node.js functionality:

  • “Node.js support management” allows customers to enable Node.js support for their domains.
  • “Node.js state management” allows customers to change the application mode for their applications.
  • “Node.js version management” allows customers to change the Node.js version for their applications.

Managing Node.js applications for websites

To learn about managing Node.js applications for websites, read the Node.js Support topic.

Managing the visibility of Node.js applications’ logs

Node.js applications write their logs (including the applications’ console output) to the following locations:

  • (Plesk for Linux) /var/log/passenger/passenger.log
  • (Plesk for Windows) %plesk_vhosts%<webspace_name>\logs\iisnode

It can be useful to view these logs if you need to troubleshoot a Node.js application.

By default, you as well as your customers and resellers can view logs of Node.js applications in domain log browser. You can manage the visibility of these logs in domain log browser via panel.ini file.

To manage the visibility of Node.js applications’ logs in domain log browser:

  1. Open the panel.ini file for editing, which is located here:

    • (Plesk for Linux) /usr/local/psa/admin/conf/panel.ini
    • (Plesk for Windows) %plesk_dir%admin\conf\panel.ini

    You can also edit the file in the Plesk interface using the Panel.ini Editor extension.

  2. Under [ext-nodejs], add the following line and save the file:

    • (To show the logs) showApplicationLogs = true
    • (To hide the logs) showApplicationLogs = false