Skip to main content
This article describes how to install and configure composer, the dependency manager solution for PHP. Composer enables you to manage dependencies for each project independently, and is used by frameworks such as Laravel.

Installing composer

To install composer, follow these steps:
  1. Log in to your account using SSH.
  2. To download and install composer, type the following commands:
    📘 Note To confirm composer installed correctly, type the following command:
    The composer.phar file should be listed in the ~/bin directory.
  3. To create a helper script to run composer, type the following command:
  4. To make the helper script executable, type the following command:
  5. To configure your shell environment so you can run composer from any directory, type the following commands:
    📘 Note
    • To confirm composer is configured correctly, type the following command from any directory:
      Composer should display the version number.
    • In the future, to update the composer installation to the newest version, type the following command:

More information

For more information about PHP Composer, go to https://getcomposer.org.