Plesk makes hosting Node.js applications straightforward with its built-in Node.js extension. You can configure, install dependencies, and manage your app entirely from the web interface.

Prerequisites

  • The Node.js extension must be installed on the server. If you do not see the Node.js option, contact your hosting provider.
  • Your application files ready to upload (including package.json).

Step 1: Upload your application files

  1. Log in to Plesk.
  2. Go to Websites & Domains and find your domain.
  3. Click Files and create a directory for your app (e.g. myapp).
  4. Upload your application files into that directory using File Manager, FTP, or the Git extension.

Step 2: Configure the application

  1. Go to Websites & Domains and click Create Website > Node.js on your domain card.
  2. Node.js Version: Select the version your app requires.
  3. Package Manager: Choose npm or Yarn (Plesk auto-detects, but you can override).
  4. Document Root: Set to the directory containing your static files (e.g. myapp/public).
  5. Application Root: Set to the directory containing your app files (e.g. myapp).
  6. Application Startup File: Enter the filename that starts your app (e.g. app.js or server.js).
  7. Application Mode: Set to Development while testing, switch to Production when ready.
  8. Add any Custom Environment Variables your app needs.

Step 3: Start the application

  1. Go to Websites & Domains > your domain > Node.js.
  2. Click Enable Node.js.
  3. Click NPM Install (or Yarn Install) to install your dependencies from package.json.
  4. Click the Application URL to verify your app is running.

Running scripts

You can run scripts defined in your package.json by clicking Run Script, entering the script name, and clicking OK.

Stopping the application

Go to Websites & Domains > your domain > Node.js and click Disable Node.js. Your settings are preserved and you can re-enable at any time.

Important notes

  • Plesk uses Phusion Passenger to serve Node.js apps. Your startup file must listen on process.env.PORT.
  • The NPM Install button only appears when a package.json file exists in the application root.
  • Each domain can only have one Node.js application root. Subdomains need separate configurations.

Troubleshooting

  • App shows Apache default page: Make sure the Document Root is set correctly and Node.js is enabled.
  • 502 or startup errors: Check the application logs via the Logs tab on your domain card.
  • Missing NPM Install button: Ensure package.json exists in the Application Root directory.
Was this answer helpful? 0 Users Found This Useful (0 Votes)