Running Composer and Node.js via SSH
Composer (PHP Dependency Manager)
Composer manages PHP libraries for frameworks like Laravel, Symfony, etc.
Check if Composer is Available
composer --version
# or
php /usr/local/bin/composer --version
Install Dependencies
cd ~/public_html
composer install --no-dev --optimize-autoloader
Update Dependencies
composer update
Common Flags
| Flag | Purpose |
|---|---|
--no-dev |
Skip development dependencies |
--optimize-autoloader |
Faster class loading |
--no-interaction |
Non-interactive mode |
Node.js and npm
Check if Node.js is Available
node --version
npm --version
If not available, contact support — Node.js can often be added to your account.
Run npm Commands
cd ~/public_html
npm install
npm run build
Using nvm (Node Version Manager)
If nvm is available:
nvm install 20
nvm use 20
node --version
PHP Version for CLI Scripts
Your SSH PHP version may differ from your web PHP version. Check:
php --version
To use a specific version:
/usr/local/php82/bin/php script.php
Contact support to find the correct path for your server.