# Craft CMS 6 ENV vars

Source: https://docs.fortrabbit.com/guides/craft-cms/craft-6/env-vars
Published: 2026-11-27
Updated: 2026-11-27
Reviewed: 2026-11-27

> The ENV vars the Craft CMS 6 software template sets on fortrabbit: Laravel APP_* and DB_* settings with MySQL instead of the PostgreSQL default.


## ENV vars from the template

Version 6 of the Craft CMS [software template](/platform/concepts/software-templates) sets the Laravel and database [ENV vars](/platform/settings/env-vars):

### Craft CMS 6

| Deployment | Value |
| :--- | :--- |
| Root path | `public` |
| Deploy strategy | `replace` |
| Excluded paths | `/storage`<br/>`/node_modules` |
| Build commands | `composer install --no-dev --prefer-dist --no-interaction --no-ansi --no-progress` |
| Post-deploy commands | `mkdir -p storage/framework/{sessions,views,cache}`<br/>`php artisan migrate --force`<br/>`php artisan storage:link --force`<br/>`if php artisan craft:install:check; then php artisan craft:up; fi`<br/>`if php artisan craft:install:check; then php artisan craft:clear-caches/all; fi` |

| Environment variables | Value |
| :--- | :--- |
| APP_DEBUG | `false` |
| APP_ENV | `production` |
| APP_KEY | `!RANDOM_KEY!` |
| APP_URL | `https://${FORTRABBIT_MAIN_DOMAIN}` |
| LOG_CHANNEL | `stack` |
| LOG_STACK | `stderr` |

| Database environment variables | Value |
| :--- | :--- |
| DB_CONNECTION | `mysql` |
| DB_DATABASE | `${FORTRABBIT_DB_NAME}` |
| DB_HOST | `${FORTRABBIT_DB_HOST}` |
| DB_PASSWORD | `${FORTRABBIT_DB_PASSWORD}` |
| DB_PORT | `${FORTRABBIT_DB_PORT}` |
| DB_USERNAME | `${FORTRABBIT_DB_USER}` |

The `${FORTRABBIT_…}` values are [platform variables](/platform/settings/env-vars) that fortrabbit fills in. An app created without the template needs them added by hand:

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

## Differences to Craft 5

- `DB_CONNECTION=mysql` is needed: the `.env.example` of the Craft 6 skeleton sets `pgsql`.
- `APP_KEY` replaces `CRAFT_SECURITY_KEY`. The template generates a random one. Data encrypted locally needs the local key on fortrabbit too.
- `APP_URL` sets the URLs of the Control Panel. Without it, links point to `localhost`.
- `LOG_STACK=stderr` sends the logs to the [logs](/platform/settings/logs) of the environment.

Settings in `config/craft/general.php` read ENV vars with Laravel's `env()` helper.
