There are multiple ways to install Composer to use with your Drupal site. Composer can be used with Linux/Unix/macOS/Windows. Remember that Composer is primarily a tool to help keep your Drupal site dependencies updated.
Composer can be installed globally (to the entire server), or specifically to a Drupal directory. We will typically recommend that the application be installed where it will be used. This is to limit it so that it is only used where your site is installed.
The developers of the application have provided an installer that you can download. Use the installer to ensure that the application is appropriately installed.
Looking for a new server for your Drupal site? Check out InMotion’s Managed VPS solutions for a hosting server that can scale to meet your performance or budget needs.
In order to run Composer, you will need PHP 5.3.2+. Composer will also run on Windows, Linux, or MacOS.
The installation will be described from the perspective of a terminal from a Linux-based server. If you are an InMotion Hosting subscriber, then your hosting server will meet the system requirements and cPanel provides terminal access to your account.
- Log in to cPanel.
- Open the cPanel File manager, then navigate to where you will install the Drupal site.
- Copy the Installer file into your folder location.
- Optionally, you can also bypass the Installer and simply upload the composer.phar file. You can find the download links at the bottom of the page. Installer will check for requirements and provide warnings for issues that you may need to correct in order for Composer to properly work. However, it’s been my experience that Composer will operate within the InMotion Hosting account. If you find yourself needing to edit the php.ini file, check out How to Use the MultiPHP INI Editor
- Once the installer file has completed, it will upload the composer.phar file into your folder.
This completes the installation of the Composer to use with your Drupal installation. You can check to see if it’s working by simply running a brief command.
- Launch your cPanel Terminal.
- Navigate to the Drupal installation folder where you have installed Composer.
- Use the following command:
You will then see a brief description of Composer:
This completes our article on installing Composer for Drupal. To learn more about Drupal, check out the Drupal Educational Channel on our Support Center website.
Learn how to manage critical server administration functions, cPanel and WebHost Manager (WHM) with our Managed VPS Hosting Product Guide.