15Jun2020
Read time: 2 mins
Posted in:
Metal figure of a composer.

Drupal 8 and 9 both require the use of the Composer Dependency Manger for installation and updating of Drupal core and contributed modules.

In this article I’m going to show you how to install the Composer Dependency Manager for Windows. In order to install Composer you must already have php installed, and on Windows that is usually as part of a WAMP, or XAMPP installation. The screen captures below are from a computer with WAMP 3.1.9 64 bit installed. My installation includes:

Apach 2.4.39
PHP 7.0, 7.1, 7.2, and 7.3
MySQL 5.7.26
MariaDB 10.3.14

Let’s get started.

  1. Download the Composer installer from the Composer web site https://getcomposer.org/doc/00-intro.md#installation-windows

    composer-install-1.jpg
  2. Find the Composer-Setup.exe file in your Downloads directory and double-click it to open the installer and launch the set-up process. Select ‘Install for all users (recommended).’

    composer-install-2.jpg
  3. Do not check the Developer mode checkbox, click Next.

    composer-install-3.jpg
  4. The path to php should be automatically detected, if not you can browse to a find the php version you want Composer to use. Click Next.

    composer-install-4.jpg
  5. Leave the path to the proxy blank and click Next (unless you are using a proxy server).

    composer-install-5.jpg
  6. Composer is now ready to install and will show a summary of your settings, you can go back and make changes if necessary. Click Install.

    composer-install-6.jpg
  7. Composer is now installed. Click Finish.

    composer-install-7.jpg
  8. You can now verify your installation by opening a CMD prompt and typing 'composer –V' to see the version number. It does not matter what directory you’re in, we installed Composer so it’s available everywhere.

    composer-install-8.jpg
  9. To see more info about your installation including available Composer commands just type 'composer' and you’ll see something similar to below.

    composer-install-9.jpg

That’s it, Composer is now installed and you can use it to manage your projects, such as creating a new Drupal 9 web site. Just navigate to the root directory of your project and run the required Composer commands there. Refer to the Composer documentation for more information on Composer.

John Moruzi, owner and web designer at WebFire Designs in Brantford, ON.

John Moruzi is a web designer, and the owner of WebFire Designs, a small web design firm in Brantford, ON. He focuses on building powerful Drupal web sites that engage customers and drive traffic. He looks forward to sharing tips and tricks he's learned building Drupal websites for more than 15 years.