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:
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.
-
Via the Pantheon Dashboard:
- Use the Empty Site Upstream
-
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.
-
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 thecreate-projectcommand. -
Copy the
upstream-configurationfolder to your site:
- Copy the
pantheon.upstream.ymlfile to your site:
- Create an empty
configfolder:
Update Composer Settings
Add/modify the settings in composer.json as follows, replacing the Drupal values with the latest version:
-
Add the
upstream-configurationpath repository: -
Include the following in the
requiresection: -
Add
pantheon-systems/drupal-integrationsand Quicksilver scripts (optional) toextra: -
Add
autoload.classmap: -
Add these
scriptsandscripts-descriptionsections:
Update settings.php
Add the following to your /web/sites/default/settings.php file.
Initialize, Push, and Test
-
Initialize the git repo and commit everything:
-
Add the Pantheon repository as a remote:
If you need to get
pantheon_remote, use Terminus: -
Force push to Pantheon
masterbranch: -
Install your site in the dev environment and test that everything works.