Site Building

11.3. Downloading and Installing a Module from Drupal.org for Drupal 8, 9, 10, and 11

Goal

Download and install the contributed Admin Toolbar module, which allows you to easily browse through the administration section of the website.

Site prerequisites

Composer must be installed to download modules. If you want to use Drush, Drush must be installed. See Section 3.2, “Concept: Additional Tools”.

Steps

Sprout Video

To install a contributed module, first download the module with Composer. Then install it using either the administrative interface or Drush. If you are installing a custom module rather than a contributed module that is not available via Composer, skip the steps for downloading the module, and refer to Section 11.6, “Manually Installing Module or Theme Files”. Then return here and follow the steps for installing the module using either the administrative interface or Drush.

Download the contributed module with Composer

  1. On the Admin toolbar project page on drupal.org (https://www.drupal.org/project/admin_toolbar), scroll to the Releases section at the bottom of the page.
  2. Copy the provided Composer command for the version of the module you want to install.

    Image
    Finding a module’s composer install command

  3. Alternatively, type the following command (substituting the short name of the module and desired version for admin_toolbar:^3.5):

    composer require 'drupal/admin_toolbar:^3.5'
  4. At the command line, change to the root directory of your project. Paste the Composer command and execute it.
  5. You should see a message about the module being successfully downloaded.

Install the module using the administrative interface

  1. In the Manage administrative menu, navigate to Extend (admin/modules). The Extend page appears.
  2. Locate the Admin toolbar module and check it.

    Image
    Installing Admin Toolbar module

  3. Click Install to turn on the new module.

Install the module using Drush

  1. Run the following Drush command, giving the project name (for example, admin_toolbar) as a parameter:

    drush pm:enable admin_toolbar
  2. Follow the instructions on the screen.

Expand your understanding

Drupal User Guide