Craft CMS setup at fortrabbit

Published

Updated

Create an app at fortrabbit for a Craft CMS project. The Craft CMS software template sets the root path, the ENV vars and the deployment commands.

Install and deploy run down

  1. Install Craft CMS locally
  2. Setup an app at fortrabbit ← you are here
  3. Deploy code via Git
  4. Database syncing
  5. Assets syncing

Git deployment needs the fortrabbit GitHub App on the GitHub account. Check it in the account settings:

Skip this step for an upload with SFTP or rsync.

Create an app at fortrabbit

Create a new app in the dashboard, the wizard guides through the steps:

With the GitHub App installed, connect the repository now: fortrabbit detects Craft CMS from it. Without a repository, choose Craft CMS from the software list.

Configuration

Choosing Craft CMS applies its software template. It sets the root path to web, the ENV vars, the build commands and the post-deploy commands:

Craft CMS 5, 4, 3

DeploymentValue
Root pathweb
Deploy strategymerge
Replaced paths/config/project
Excluded paths/node_modules
Build commandscomposer install --no-dev --prefer-dist --no-interaction --no-ansi --no-progress
Post-deploy commandsphp craft migrate/allphp craft project-config/applyphp craft clear-caches/all
Environment variablesValue
CRAFT_ENVIRONMENT${FORTRABBIT_ENVIRONMENT_NAME}
CRAFT_DEV_MODEfalse
CRAFT_ALLOW_ADMIN_CHANGESfalse
CRAFT_ALLOW_UPDATESfalse
CRAFT_SECURITY_KEY!RANDOM_KEY!
PRIMARY_SITE_URLhttps://${FORTRABBIT_MAIN_DOMAIN}
CRAFT_STREAM_LOGtrue
Database environment variablesValue
CRAFT_DB_SERVER${FORTRABBIT_DB_HOST}
CRAFT_DB_DRIVERmysql
CRAFT_DB_DSNmysql:host=${FORTRABBIT_DB_HOST};port=3306;dbname=${FORTRABBIT_DB_NAME}
CRAFT_DB_PASSWORD${FORTRABBIT_DB_PASSWORD}
CRAFT_DB_USER${FORTRABBIT_DB_USER}

Written by a human. Review, grammar checks and typo fixes by AI.

AI use & editorial processEdit on GitHub ↗