---
title: "Installing a Drupal distribution"
date: "2024-02-14T06:18:38+00:00"
summary: "Learn how to install Drupal distributions on Acquia Cloud Platform using Composer, Cloud IDE, or manual methods. Step-by-step guide included."
image:
type: "page"
url: "/acquia-cloud-platform/installing-drupal-distribution"
id: "e7334545-50a2-4bea-abb8-22d13ea7a521"
---

Table of contents will be added

Important

*   The [Remote Administration](https://docs.acquia.com/acquia-cms/ra) service is incompatible with the Drupal tarball installation process. However, [Remote Administration](https://docs.acquia.com/acquia-cms/ra) is compatible with Drupal Composer-based sites.
*   Composer-based installs are recommended for real applications. For more information, see [IDE](/acquia-cloud-platform/add-ons/cloud-ide/overview "Overview").

To install a Drupal distribution (or Drupal core), use one of the following:

*   [Composer](#install-drupal-composer) (Recommended)
*   [Cloud IDE](#ide-install-drupal) (Recommended)
*   [Tar or Zip file](#download-manually) (Not recommended)

A [Drupal distribution](/definitions/distribution) is a custom edition of Drupal, tuned and extended with custom developed and contributed modules to enable desired features. Such a distribution includes Drupal core, Drupal contributed modules, themes, libraries, and installation profiles that together provide a Drupal solution. You can install most of the popular Drupal distributions in Cloud Platform. To [import a Drupal distribution](/acquia-cloud-platform/create-apps/import) to Cloud Platform, you can leverage one-click selection.

Note

When first installing the Drupal.org-provided core Drupal distribution for the [current Drupal version](/service-offerings/guide/software-life-cycle#supported-drupal-version), the system prompts you for a database password. Do not enter a password for the database, but instead click **Save and Continue**.

Prerequisites for installing Drupal 11
--------------------------------------

The following are the prerequisites for installing Drupal 11:

*   PHP 8.3 is not set as the default version. Therefore, update your environments and developer tools such as Code Studio and Cloud IDE to use PHP 8.3.
    
*   If you use the [mysql57](/acquia-cloud-platform/mysql-80-57-backport-database-driver-upgrading-drupal-11 "https://docs.acquia.com/acquia-cloud-platform/develop-apps/drupal-apps/mysql-80-57-backport-database-driver-upgrading") module with Cloud IDE, PHPUnit tests that use the database fail with an error stating that the database server version of 5.7 is less than the minimum required version of 8.0. To resolve this error, update the `SIMPLETEST_DB` environment variable to add `?module=mysql57`:
    
        export SIMPLETEST_DB="mysql://drupal:drupal@127.0.0.1/drupal?module=mysql57"
    

Installing a Drupal distribution through Composer
-------------------------------------------------

### Prerequisites

Ensure that your development environment has the following:

*   [Composer](https://getcomposer.org/download/)
*   [Git](https://git-scm.com/downloads)

### Steps

1.  Clone your Acquia repository into a new folder such as `ProjectName`, and create a branch:
    
        git clone sitename@serverName.hosting.acquia.com:Sitename.git ProjectName
        cd ProjectName
        git checkout -b MyBranchName
    
2.  Create `composer.json` and `composer.lock` files:
    
        composer create-project --no-install drupal/recommended-project .
    
    Ensure that you include the dot at the end of the command.
    
3.  Modify the `composer.json` file by replacing `web` with `docroot`. Use your preferred editor or run the following command:
    
        sed -i'.original' 's/web\//docroot\//g' composer.json
    
4.  Run the following command to install the latest version of Drush in your codebase:
    
        composer require drush/drush --no-update
    
5.  Complete the following optional steps based on your requirement:
    1.  Add [asset-packagist.org](http://asset-packagist.org/) as another repository to provide access to supplement [packages.drupal.org](https://packages.drupal.org/) and additional packages:
        
            composer config repositories.1 composer https://asset-packagist.org
        
    2.  Configure the location and name of the vendor directory:
        
            composer config vendor-dir vendor
        
    3.  Select your preferred installation type from the following options:
        *   source
        *   dist
        *   auto
            
                composer config preferred-install dist
            
    4.  Add the following useful future project patches:
        
            composer require cweagans/composer-patches --no-update
        
    5.  To add a patch to core or a module, include the following lines in the `extra` section in your `composer.json` file for future patches:
        
            {
             "enable-patching": true,
             "patches": {
               "drupal/[module_name]": {
                 "Note regarding the nature of the patch being applied": "https://www.drupal.org/files/issues/[patch_name].patch"
               }
             }
            }
        
        For more information, see [Patching with Composer](https://docs.acquia.com/acquia-cloud-platform/develop-apps/composer#composer-patch).
        
    6.  Configure Composer to continue if a patch fails:
        
            composer config extra.composer-exit-on-patch-failure false
        
    7.  To remove `.git` folders after each update to ensure that git tracks all files, include the following lines after the `extra` section in your `composer.json` file:
        
            {
             "scripts": {
               "post-install-cmd": [
                 "find docroot vendor -name '.git' | xargs rm -rf",
                 "find docroot vendor -name '.github' | xargs rm -rf"
               ],
               "post-update-cmd": [
                 "find docroot vendor -name '.git' | xargs rm -rf",
                 "find docroot vendor -name '.github' | xargs rm -rf"
               ]
             }
            }
        
6.  Run the following command to install all dependencies:
    
        composer update --lock
    
    Composer performs the following:
    
    *   Creates a Drupal project
    *   Ensures that Drupal uses a directory structure that Acquia recommends
    *   Adds the latest version of Drush as a required dependency
7.  Copy `default.settings.php` to the `settings.php` file to add your database connection.
    
        cp docroot/sites/default/default.settings.php docroot/sites/default/settings.php
    
    For instructions about modifying the `settings.php` file, see [Acquia require line](https://docs.acquia.com/acquia-cloud-platform/manage-apps/code/require-line).
    
8.  Add the following to your `settings.php` file for [configuration management](https://docs.acquia.com/acquia-cloud-platform/develop-apps/config-drupal):
    
        $settings["config_sync_directory"] = $app_root . '/../config/' . basename($site_path);
    
9.  Add and commit your code:
    
        git add .
        git commit -m "Initial commit of new Drupal core site."
    
10.  Run the following command to push your changes to the Acquia repository and create a tracking branch on the remote repository:
     
         git push --set-upstream origin MyBranchName
     
11.  Navigate to your Cloud Platform application, and switch the code to your branch on your preferred testing environment.
12.  Set your Cloud Platform environment to use the latest PHP version.
13.  If your environment contains an existing database that one of your Drupal websites uses, Acquia recommends you to perform the following:
     *   [Perform a database backup](https://docs.acquia.com/acquia-cloud-platform/manage-apps/back-up#cloud-db-backups).
     *   [Download your Cloud Platform Drush aliases](https://docs.acquia.com/acquia-cloud-platform/manage-apps/command-line/drush/aliases).
     *   Use Drush to drop the database on your Cloud Platform environment so that you have a clean database for your Drupal site install:
         
             ../vendor/bin/drush @my.alias sql-drop
         
14.  Click the link in the Cloud Platform user interface to access the URL of the Cloud Platform environment, and proceed to `/core/install.php`.
15.  Follow the prompts on your website to complete the installation process.

Important

To leverage [Drupal Starter Kits](/drupal-starter-kits/overview "Overview") and add-ons in your Drupal distribution, use one of the methods described in [Installing Drupal Starter Kits](/drupal-starter-kits/installing-drupal-starter-kits "Installing Drupal Starter Kits").

Installing a Drupal distribution in a Cloud IDE
-----------------------------------------------

[Cloud IDE](https://docs.acquia.com/acquia-cloud-platform/add-ons/ide) also offers a convenient and opinionated way to install Drupal.

To install a Drupal distribution using a Cloud IDE:  
 

1.  Launch your Cloud IDE. If you have not yet created a Cloud IDE, follow the instructions on [Getting started with Cloud IDE](https://docs.acquia.com/acquia-cloud-platform/add-ons/ide/start).
2.  From the IDE Get Started page, click **CREATE A NEW APPLICATION**.
    
    ![cloud-platform_installing-drupal-in-ide.png](https://acquia.widen.net/content/c220b8fe-740f-4f34-8d22-eb0821371c77/web/cloud-platform_installing-drupal-in-ide.png?w=720&itok=MfTyHRoT)
    
    A terminal pane pops up and prompts you to install the [Acquia Drupal recommended project](https://github.com/acquia/drupal-recommended-project#acquia-drupal-recommended-project) or the [Acquia Drupal minimal project](https://github.com/acquia/drupal-minimal-project).
    
3.  Select your target version by typing the number associated with your distribution selection in the terminal prompt and press **Enter**. [Acquia CLI](https://docs.acquia.com/acquia-cloud-platform/add-ons/acquia-cli) takes care of automatic installation of Drupal in Cloud IDE’s `/home/ide/project` directory.
    
    ![cloud-platform_installing-drupal-through-acli.png](https://acquia.widen.net/content/685c9d01-7c34-4752-a532-5f87534f12c5/web/cloud-platform_installing-drupal-through-acli.png?w=720&itok=hvoTnW5l)
    
    After Drupal is installed, you can start developing or push from the IDE terminal to Cloud Platform with `acli push:db` and `acli push:files`. As a best practice, your codebase remains to be managed with [Git](https://docs.acquia.com/acquia-cloud-platform/develop-apps/repository/git#git-best-practices).
    

Downloading Drupal distribution manually and deploying to Cloud Platform
------------------------------------------------------------------------

To install a Drupal distribution on Cloud Platform, you can [download](https://dev.acquia.com/downloads) a Cloud Platform compatible `.tar` or `.zip` file of the latest Drupal release and complete the following steps:

1.  Decompress the downloaded archive into the `docroot` directory of your Acquia Git repository.
2.  Add a `settings.php` file and update it by following the instructions on [Acquia require line](https://docs.acquia.com/acquia-cloud-platform/manage-apps/code/require-line).
3.  Commit and push your changes to Cloud Platform using [Git](https://docs.acquia.com/acquia-cloud-platform/develop-apps/repository/git).
4.  Set your Cloud Platform environment to use [PHP 7.4 or later](https://docs.acquia.com/acquia-cloud-platform/manage-apps/php#cloud-php-version-used).
5.  If your environment has an existing database that was used by one of your Drupal websites before, Acquia recommends you to:
    1.  [Perform a database backup](https://docs.acquia.com/acquia-cloud-platform/manage-apps/back-up#cloud-db-backups)
    2.  [Download your Cloud Platform drush aliases](https://docs.acquia.com/acquia-cloud-platform/manage-apps/command-line/drush/aliases)
    3.  Use Drush to drop the database on your Cloud Platform environment (replace `@my.alias` with the appropriate alias for your application and environment) as displayed in the following example:
        
            ./vendor/bin/drush @my.alias sql-drop
        
        This ensures you have a clean database for your Drupal install.
        
6.  Click the link in the Cloud Platform user interface to access the URL for the Cloud Platform environment and proceed to `/core/install.php`.
7.  Follow the prompts on your website to complete the installation process.

Related topics
--------------

*   [Creating a new application](https://docs.acquia.com/acquia-cloud-platform/create-apps)