# Deploy Drupal to fortrabbit

Source: https://docs.fortrabbit.com/guides/drupal/deployment
Published: 2026-11-15
Reviewed: 2026-11-15

> Create a Drupal app on fortrabbit, deploy it with Git, and let drush deploy import the configuration after every deployment.


## Install and deploy run down

1. [Install Drupal locally](/guides/drupal/install)
2. **Deploy Drupal to fortrabbit** _← you are here_
3. [Database syncing](/guides/drupal/database)
4. [Files syncing](/guides/drupal/files)

## Code, database and files

A Drupal site has three parts, and each one travels its own way:

| Part | What | How |
|---|---|---|
| Code | Drupal, modules, themes, `config/sync` | Git push |
| Database | Content, users, active configuration | [`frbit db`](/guides/drupal/database) |
| Files | Uploads in `web/sites/default/files` | [`frbit files`](/guides/drupal/files) |

Code goes up with every push. Database and files go up once to bring the site live, then mostly down, to work locally with live content.

## Create the app

Create an app with Drupal as the software and connect the GitHub repository. The [software template](/platform/concepts/software-templates) then sets:

- the [root path](/platform/settings/root-path) `web`
- `composer install --no-dev` as the [build command](/platform/deployment/build-commands)
- `drush deploy` as the [post-deploy command](/platform/deployment/post-deploy-commands)
- `web/sites/default/files` as an [exclude pattern](/platform/deployment/exclude-patterns), so uploads survive deployments
- the `DB_*` ENV vars from the [MySQL component](/platform/components/mysql) and a random `DRUPAL_HASH_SALT`, read by the [settings.php block](/guides/drupal/install#settingsphp)

With General PHP or another software, these ENV vars are missing and Drupal finds no database.

} / {{app-env-name}}" path="/environments/{{app-env-id}}/settings/rootpath"}

## First deployment

Connecting the repository deploys the code. The site does not run yet: the database is empty. Push the local database and files up, as in [database up](/guides/drupal/database#database-up) and [files up](/guides/drupal/files#files-up):



```shell
ddev export-db --file=local.sql.gz
frbit db push local.sql.gz {{app-env-id}}
frbit files push web/sites/default/files -e {{app-env-id}}
```

Or install a fresh site over SSH with `frbit ssh {{app-env-id}} -- vendor/bin/drush site:install`.

## Drush deploy

Every deployment runs `drush deploy` as its post-deploy command. It applies pending database updates of core and modules, imports the configuration from `config/sync`, rebuilds the caches and runs deploy hooks. The template skips it while Drush is missing or no site is installed yet, so the first deployment of a fresh environment passes:



```shell
if vendor/bin/drush status --field=bootstrap 2>/dev/null | grep -q Successful; then vendor/bin/drush deploy; else echo 'No drush or no installed Drupal site, skipping drush deploy'; fi
```

Drush has to be in `require` of `composer.json`: the build skips `require-dev`. Drupal CMS ships Drush as a dev dependency, `composer require drush/drush` moves it.

A configuration change follows the Drupal way: change it locally, export, commit, push. The next deployment imports it.



```shell
ddev drush config:export -y
git add config/sync
git commit -m "Update config"
git push
```

`drush deploy` refuses an empty sync folder, and the deployment fails. Export and commit the configuration before the first deployment that runs it.

## Drush over SSH

Run Drush on the environment with `frbit ssh`, or over plain [SSH](/platform/code-access/ssh):



```shell
frbit ssh {{app-env-id}} -- vendor/bin/drush status
```

## Logs

Drupal keeps its own log at `/admin/reports/dblog`. PHP errors show up in the [logs](/platform/settings/logs) of the dashboard.
