Issue with Composer Installation

I am writing to seek assistance with an issue I am facing while attempting to install Composer on my HestiaCP panel.
Despite following the official Composer installation instructions and trying various methods, I am consistently encountering the following error message when attempting to execute the ‘composer --version’ command:

Command 'composer' not found, but can be installed with: apt install composer
Please ask your administrator.

I have already successfully installed Composer on my server, and I can confirm its presence using the ‘composer --version’ command outside of HestiaCP. However, when attempting to use Composer within a specific HestiaCP account, the command does not seem to be recognized.
Additionally, I have navigated to the ‘.composer’ directory and attempted to execute the ‘composer’ command from there, but I still encounter the same error.

I have also tried using the ‘v-add-user-composer’ command, but it returns an error stating that the account does not exist, even when attempting with the ‘admin’ account.

I would greatly appreciate your guidance on resolving this matter. If there are specific steps or configurations needed to integrate Composer successfully within a HestiaCP account, please provide detailed instructions. Additionally, if there are any logs or specific information required for troubleshooting, please let me know, and I will gladly provide it.

Thank you for your time and assistance. I look forward to your prompt response.

v-add-user-composer user

/home/user/.composer/composer install or your command

1 Like

It does not work. I get this error, I also tried with sudo to get permissions.
/usr/local/hestia/func/ line 1575: /usr/local/hestia/conf/hestia.conf: Permission denied
Error: user alfredo doesn’t exist
/usr/local/hestia/func/ line 102: /usr/local/hestia/log/error.log: Permission denied
If I try with sudo I get:
alfredo is not in the sudoers file. This incident will be reported.

I also tried to log in to the terminal with the administrator account but I get the error that the account does not exist when I type v-add-user-composer alfredo or v-add-user-composer user or v-add-user-composer admin. I’m nervous.

Run v-add-user-composer user as root

Or with sudo with an user that allowed to run with sudo …

The problem persists, I logged in with the hestia administrator account in the terminal and I can’t get permissions, if I try to use sudo -i and then execute the “v-add-user-composer” command I get:
Sorry, user admin is not allowed to execute '/bin/bash' as root on server.
I do not know what to do.

Use full path


Perfect, now it works on the admin account

admin@manage:~$ composer --version
Composer version 2.6.5 2023-10-06 10:11:52

However, if I enter the terminal with the user account where I have to use composer, I get:

alfredo@manage: Command 'composer' not found, but can be installed with:
apt install composer
Please ask your administrator.

And so it’s as if I haven’t solved it.

I tried going to the ./composer folder but I still get the same error. The files are present in the folder in question.

Use ./composer or /home/user/.composer/composer

If I type: /home/alfredo/.composer/composer works correctly thanks. However I want it to work by just typing “composer” without the entire path, how do I do it?

alias composer=/home/admin/.composer/composer

This should be added to the .bash_aliases file

After that logout and login again via ssh and it should work fine

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.