This is an example of how to set up a Statamic application to deploy on Kinsta’s Application Hosting services.

Statamic is a powerful, flat-file CMS built on Laravel and includes the following key features:

  • There’s no database until you need one.
  • It’s a front-to-back CMS until you need to go headless.
  • It’s dynamically powered by PHP & Laravel until you need to go static.
  • It’s full-stack until you go JAMstack.
  • Host it on any modern PHP server until you want to go serverless.
  • Use the control panel unless you don’t feel like it. Code editors are great, too.
  • You can version-control everything unless you don’t want to.

More info is available on the Statamic website.

Statamic is based on Laravel. This means that it’s a regular PHP-based application, so during the deployment process, Kinsta automatically installs dependencies defined in your composer.json file.

  1. Fork this GitHub repository: Kinsta – Statamic Boilerplate.
  2. As Statamic is based on Laravel, it requires the APP_KEY environment variable to be set. You can generate an app key yourself locally, or you can use this online Laravel key generator.
  3. In MyKinsta, add an application with the Statamic Starter repository. In Environment variables:
    1. In Key 1, enter APP_KEY, and in Value 1, paste the key generated from Step 2.
    2. Click Add another and in Key 2, enter APP_KINSTA, and in Value 2, enter true.
    3. Select Available during runtime and Available during build process.
  4. The Start command can be left blank for the web process as Kinsta automatically detects the required command during the first deployment.
  5. We want our application to also build our CSS/JS files, so we need to add two buildpacks: Node JS and PHP. Click Settings > Add buildpack, select NodeJS > Add buildpack. Repeat this for PHP.
  6. Click Deployments > Deploy now > choose the required branch > Deploy application.

The app is available as soon as the build finishes and the Statamic Welcome page loads at your application’s URL.

Statamic welcome page after successful installation.
Statamic welcome page after successful installation.

Environment Variables

Statamic requires the following environment variables to be set:

Web Server Setup

Start Command

The default web process is heroku-php-apache2 public/. If needed, you can change this command when adding your application (Set up your processes) or on the application’s Processes page after deployment.