Skip to main content
Last Reviewed: 2022-12-13

Create a Drupal Site Using a Drupal Distribution

Learn how to create a site using a Drupal distribution.


Distributions are pre-made packages that you can use to simplify creating and setting up a Drupal website. Drupal distributions are exceptionally helpful if you want to create a website, but don't want to build it from scratch.

Review the documentation provided with the community distribution before following the steps below.

Prepare

Review our documentation on Git, Composer, and Terminus, and install and configure them on your local computer. Pantheon requires Composer 2 at minimum.

  • Mac users can use Homebrew to install Git, Composer, and PHP, along with their required dependencies. Restart the shell or terminal environment after entering the following command:
  • Windows users can install Composer and Git, and may need to install XAMPP or similar to satisfy some dependencies.

Create a Site Based on an Empty Upstream

There are two ways to create an empty Upstream site: via the Pantheon Dashboard and via Terminus.

Create the Project

Use the documentation provided with the Drupal distribution to run the recommended Composer create-project command.

You can review a list of commonly used distributions on the Drupal Distributions page.

Add Files and Folders

Now you're going to copy files and folders from the Pantheon GitHub repository for use in your project.

  1. Clone https://github.com/pantheon-upstreams/drupal-composer-managed into another folder.

    In the code samples included below, [drupal-composer-managed-path] should be replaced with the location of the cloned repository. In addition, they assume the commands are being run from the folder created from the create-project command.

  2. Copy the upstream-configuration folder to your site:

  1. Copy the pantheon.upstream.yml file to your site:
  1. Create an empty config folder:

Update Composer Settings

Add/modify the settings in composer.json as follows, replacing the Drupal values with the latest version:

  1. Add the upstream-configuration path repository:

  2. Include the following in the require section:

  3. Add pantheon-systems/drupal-integrations and Quicksilver scripts (optional) to extra:

  4. Add autoload.classmap:

  5. Add these scripts and scripts-description sections:

Update settings.php

Add the following to your /web/sites/default/settings.php file.

Initialize, Push, and Test

  1. Initialize the git repo and commit everything:

  2. Add the Pantheon repository as a remote:

    If you need to get pantheon_remote, use Terminus:

  3. Force push to Pantheon master branch:

  4. Install your site in the dev environment and test that everything works.

More Resources