Composer can basically be used, but it is not directly available as a global command via SSH.
Instead, usage is done through the file composer.phar provided by Composer.
For more information, see here: How do I connect to my webspace via SSH?
First, connect to your webspace via SSH and switch to your project directory.
Then follow the installation steps from the official Composer website: https://getcomposer.org/download/
After installation, the file composer.phar will be in your project directory.
Since Composer is not available globally, the composer.phar file must be executed via PHP.
Example:
Standard command:
composer require symfony/dotenv
Adjusted command:
php composer.phar require symfony/dotenv
If you want to use a specific PHP version, you can specify it directly:
php8.2 composer.phar require symfony/dotenv