Categories: Plesk

Node.js Support – Plesk Onyx

Demo Video: Learn how to add and manage Node.js applications in Plesk

To install a Node.js application on your website, you need to upload the application’s files to the server first. You can upload them via FTP or using the File Manager.

To set your application up, go to Websites & Domains and click Node.js. On this screen you can see a number of controls that will help you manage your Node.js application:

  • Node.js Version. This control displays the currently selected version of the runtime environment that will be used to run your application. Click the version number to select a different Node.js version.
    Document Root. Here you can set the domain’s document root directory, which must be a subdirectory of the application root directory, specified below.
  • Application Mode. You can select between “Development” and “Production” modes, or type a custom mode name. The NODE_ENV environment variable will reflect your choice.
  • Application URL. Click this automatically generated URL to open the application in your browser.
  • Application Root. By default, the application root is the domain’s root directory. Click “[open]” to browse the contents of the application root directory using the File Manager. Additionally, in Plesk for Linux, you can click the currently set application root path to set a custom application root.
  • Application Startup File. By default, the startup file name is presumed to be app.js. Click it to type a custom startup file name.
    (Plesk for Linux only) Custom environment variables. Here you can see a list of custom environment variables you have set for your application (if any). Click “[specify]” to add or remove environment variables for your application:
    1. Click Add variable to add another environment variable to the list. Type in the variable name in the left field, and its desired value in the right.
    2. Edit the variables already on the list by clicking the corresponding field and typing in the new variable name or value.
    3. Click Remove next to a variable to remove it from the list.

    Click Ok when finished.

    If the application root directory contains the package.json configuration file, two additional controls become available:

  • NPM install. Installs the package(s) described in the package.json file.
    Run script. Runs a command specified in the “Scripts” section of the package.json file. Specify the name of the script to run plus any parameters, then click Ok.
  • If your application files include the package.json, Gruntfile.js, gulpfile.js, or webpack.config.js configuration files, they will be listed in the “Access to Configuration Files” section on the right. Click the name of a configuration file to open it for editing.
  • Once you have finished configuring your application, click Enable Node.js to start it. The information about your application, including the Node.js version and the application mode will be displayed below the domain name together with the Restart App button.

    If, at a later date, you should need to disable Node.js, go to Websites & Domains, click Node.js, and then click Disable Node.js. Disabling Node.js does not affect your settings, and you can reactivate your application at any time.

    Admin

    Share
    Published by
    Admin

    Recent Posts

    Enable Outgoing SMTP Server Authentication

    All our servers need you to enable outgoing SMTP server authentication to be able to…

    4 years ago

    Plesk Tutorials – How to configure DNS for a domain in Plesk

    Learn how to configure and check your DNS settings in Plesk. After you registered your…

    5 years ago

    cPanel Tutorials – Force HTTPS Redirect

    This video demonstrates how to use the Force HTTPS Redirect feature. This feature allows you…

    5 years ago

    cPanel Tutorials – MultiPHP Manager

    Use cPanel's MultiPHP Manager to manage your domains' PHP version. Being able to manage the…

    5 years ago

    Email account setup in Outlook 2016

    This tutorial will help you to configure Microsoft Outlook 2016 for an email account. Step…

    5 years ago

    Message Queueing

    Generally emails are directly delivered to the destination server. However, if the delivery attempt to…

    5 years ago