Note! Starting from cPanel version v.130, cPanel no longer provides direct Composer support; it must be added manually per user account!

Some customers and/or their developers have wanted to use the Composer tool on a shared hosting user account.
Here is a short guide for installing and using it.

1. Log in to your cPanel account (instructions: HERE) and from cPanel go to Tools -> Advanced -> Terminal
2. Download the Composer installer:

curl -sS https://getcomposer.org/installer | php

3. Create the required folder and move the file there:

mkdir bin
mv composer.phar $HOME/bin/composer

4. Add the Composer path to your account’s .bashrc file:

export PATH="$PATH:~/bin/"
source ~/.bashrc

5. Log out and back in via SSH – now the path should be visible with the command:

echo $PATH

You can check the Composer version with the command:

composer --version

The result should look like: “Composer version 2.x.x …”

The above steps as a single command sequence:

curl -sS https://getcomposer.org/installer | php
mkdir bin
mv composer.phar $HOME/bin/composer
export PATH="$PATH:~/bin/"
source ~/.bashrc

Note! This guide works for PHP versions 7.2.5 and newer. If you want to use Composer with an older PHP version (below 7.2.5), run additionally:

composer self-update --2.2

If you want to return to the latest Composer version after the previous command, run:

composer self-update --rollback

CRON – weekly Composer update

Schedule a weekly auto-update in cPanel -> Advanced -> Cron Jobs (Mondays at 07:00):

0 7 * * 1 $HOME/bin/composer self-update &>/dev/null
IP Info:
Radicenter 2025