Skip to content

How do I add Composer to my hosting account?

Composer is not in the $PATH on cloud web hosting servers because the Composer package is continually updated. We instead recommend installing and maintaining your own Composer version compatible with your applications and workflow.

  1. Connect to your hosting account via SSH (How do I log into SSH (shared / cloud web hosting?)

  2. Create a bin directory in your home directory:

    Terminal window
    mkdir ~/bin
  3. Navigate to the bin directory:

    Terminal window
    cd ~/bin
  4. Download Composer:

    Terminal window
    curl -s https://getcomposer.org/installer | php -- --filename=composer
  5. Make Composer executable:

    Terminal window
    chmod +x composer

You should now be able to use Composer from anywhere in your hosting account by running composer.

As you are managing your own Composer installation, you will need to update it manually when new versions are released. To update Composer to the latest version, run the following command:

Terminal window
composer self-update