• The APS Catalog has been deprecated and removed from all Plesk Obsidian versions.
    Applications already installed from the APS Catalog will continue working. However, Plesk will no longer provide support for APS applications.
  • Please be aware: with the Plesk Obsidian 18.0.78 release, the support for the ngx_pagespeed.so module will be deprecated and removed from the sw-nginx package.

Issue NPM build actions in Deploy Actions w the Git Extension

yyc2006

New Pleskian
Server operating system version
Ubuntu 24
Plesk version and microupdate number
18.0.75 #2
"NPM build actions in Deploy Actions w the Git Extension"
I've been attempting to add npm install & npm run build to the deploy actions section of the git extension. This is a ubuntu server so its a chrooted environment.

After attempting explicit paths and a deploy script, I run into the same problems. Claude recommends removing the chrooted restrictions but I don't expect thats the best.

Are there any recommendations for accessing node, npm and particularily nodenv commands as part "deploy script" in the Git extension?

Claude Solutions

Option 1: Disable chroot for Git actions (Recommended) <Doesnt seem great>

In Plesk:
1. Go to Domains →[DOMAIN] → Hosting Settings
2. Find SSH access or Shell access
3. Change from /bin/bash (chrooted) to /bin/bash

Option 2: Use Plesk's Node.js feature for deployment <Looking for something automated, not a bunch of extra manual clicks>

Instead of a custom deploy script, configure Plesk's built-in Node.js:
1. Go to Domains →[DOMAIN] → Node.js
2. Enable Node.js
3. Set Application startup file: dist/main.js
4. Use Plesk's built-in "NPM install" action instead of custom script

Option 3: Run deploy via SSH (outside chroot)

Create a wrapper that SSHs to the server without chroot restrictions:
ssh user@[DOMAIN] 'cd /var/www/vhosts/[DOMAIN]/mcpserver && ./deploy.sh'
 
The simplest approach is moving from the chrooted shell to /bin/bash.

If you must use the chrooted shell, you will need to copy the Node.js dependencies to the chrooted shell.
 
Back
Top