- 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'
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'