Install Craft CMS 2 on fortrabbit

Craft is a CMS you and your clients love. Learn how to deploy Craft using Git on fortrabbit.

Get ready

We assume you've already created an App and chose Craft CMS in the stack chooser. If not: You can do so in the fortrabbit Dashboard.

Root path

If you haven't chosen Craft CMS stack when creating the App in the Dashboard, please set the following: Go to the Dashboard and set the root path of your App's domains to public.

Change the root path for App URL of App: {{app-name}}

Quick start

Start by downloading the latest Craft release from the Craft CMS website and unpack it locally. It will extract into multiple folders, so make sure that you unpack it in an empty parent directory. Now open the just extracted craft/config/db.php and change it as following:

return [
    'server'      => getenv('MYSQL_HOST')     ?: 'localhost',
    'database'    => getenv('MYSQL_DATABASE') ?: 'local-db-name',
    'user'        => getenv('MYSQL_USER')     ?: 'local-db-user',
    'password'    => getenv('MYSQL_PASSWORD') ?: 'local-db-password',
    'tablePrefix' => 'craft',

    // to be compatible with MySQL 5.7, requires 2.6.2949 or greater
    'initSQLs'     => ["SET SESSION sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';"],

];

Before you upload anything: Rename the file htaccess in the extracted folder public to .htaccess (with a . in the beginning). If your operating system makes that hard for you (hello Mac), you can first upload and then rename the file directly on fortrabbit via SFTP.

Copy everything you just extracted, including the changed db.php file and the renamed .htaccess file, via SFTP to the htdocs folder of your App. The htdocs folder is the one you are automatically in after logging in via SFTP. The SFTP access for your App {{app-name}} is:

  • Server: deploy.{{region}}.frbit.com
  • User name: {{ssh-user}}
  • Password: {{ssh-password}}

When the upload is finished, visit {{app-name}}.frb.io/admin in your browser and commence with the guided web installation to finish the setup.

After the guided web setup is done, you will be automatically redirected to the Craft CMS admin login form. Use the previously chosen Username and Password to login. Your Craft CMS is now live under 😋:

Advanced topics

See our Craft install guide for the Professional Stack to learn more about these topics:

Further readings

Search help pages

Need individual help?

Get support › Learn about Company plans ›

Looking for an old article?

See the full list of articles ›

Found an error?

Contribute on GitHub ›