Question
How to install Node.js application via Plesk?
Answer
Using Plesk UI
-
Upload the Node.js application files, including
package.json
, to the server using File Manager. -
Go to Domains > example.com > Node.js and set the application configuration:
-
Click NPM install and Run script if necessary.
From a command line (Linux only)
-
Connect to the server via SSH
-
Run
npm install "packagename"
command to fetch and install the package from a npmjs.com repository."packagename"
should be replaced with your package name. In the example below, blockchain-wallet-service application will be used.# export PATH=$PATH:/opt/plesk/node/7/bin/
# /opt/plesk/node/7/bin/npm install -g blockchain-wallet-service
# /opt/plesk/node/7/bin/blockchain-wallet-service start –port 3000Note: instead of the
root
user, it is better to use one of the system users of subscriptions to run 3rd-party applications in order to avoid possible security issues.
If there is no /opt/plesk/node/7/bin/npm
executable, go to Plesk > Tools & Settings > Updates and Upgrades > Add/Remove Components and make sure that Node.js support component is installed.