Installing Composer
Установка Composer

All English-language materials have been translated fully automatically using the Google service

Downloading and Installing Composer on Linux

Composer provides an installer written in PHP. We have to download it, make sure it isn't corrupted, and then use it to install Composer.

Make sure you are in your home directory and then download the installer with curl :

cd ~
curl -sS -o composer-setup.php

Next, make sure the installer hash matches the SHA-384 hash for the latest installer in Composer Public Keys / Signatures . Copy the hash from this page and save it as a command line variable:


Be sure to replace the last hash with the one highlighted in red.

Now run the following PHP script to make sure the install script is safe to run:

php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

You should see the following output:

Installer verified

If you see Installer corrupt , you need to download the install script again and re-verify that you are using the correct hash. Run the command and check the installer again. Once the installer has successfully verified, you can proceed.

To install composer globally, use the following command, which will download and install composer as a system-wide composer command in the / usr / local / bin directory :

sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer

The output should look like this:

All settings correct for using Composer

Composer (version 1.6.5) successfully installed to: /usr/local/bin/composer
Use it: php /usr/local/bin/composer

To test the installation, run the command:


You should get similar output with Composer version and arguments.

  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
Composer version 1.6.5 2018-05-04 11:44:59

  command [options] [arguments]

  -h, --help                     Display this help message
  -q, --quiet                    Do not output any message
  -V, --version                  Display this application version
      --ansi                     Force ANSI output
      --no-ansi                  Disable ANSI output
  -n, --no-interaction           Do not ask any interactive question
      --profile                  Display timing and memory usage information
      --no-plugins               Whether to disable plugins.
  -d, --working-dir=WORKING-DIR  If specified, use the given directory as working directory.
  -v|vv|vvv, --verbose           Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
. . .

This means that the Composer dependency manager has been successfully installed and is available system-wide.

Note: if you prefer to have separate Composer executables for each project you host on this server, you can install locally for each project. NPM users should be familiar with this approach. This method is also useful when the system user does not have system-wide rights to install software.

To do this, use the php composer-setup.php command. This will generate a composer.phar file in the current directory, which can be executed using the ./composer.phar command.


Installing composer using the Windows command line

Start the Windows console and use the cd command to navigate to the desired folder.

Execute the following commands one by one:

php -r "copy('', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

If the installation was not performed, then the checksum has changed. Go to link and get new installation commands


There are no comments yet, you can be the first to leave it

Leave a comment

The site uses a comment pre-moderation system, so your message will be published only after approval by the moderator

You are replying to a user's comment



Email me

Are you developing a new service, making improvements to the existing one and want to be better than your competitors? You have come to the right place. I offer you a comprehensive studio-level website development. From me you can order design, layout, programming, development of non-traditional functionality, implementation of communication between CMS, CRM and Data Analitics, as well as everything else related to sites, except for promotion.

Contact, I will always advise on all questions and help you find the most effective solution for your business. I am engaged in the creation of sites in Novosibirsk and in other regions of Russia, I also work with the CIS countries. You will be satisfied with our cooperation

An error occurred while sending, please try again after a while
Message sent successfully


+7(993) 007-18-96



Россия, г. Москва

By submitting the form, you automatically confirm that you have read and accept the Privacy Policy site

Contact with me
Send message
By submitting the form, you automatically confirm that you have read and accept Privacy policy of site
Sending successful!
Thank you for contacting :) I will contact you as soon as possible
Sending failed
An error occurred while sending the request. Please wait and try again after a while or call my phone number