Hosting Ghost CMS on Clever-Cloud with MySQL and Cellar (S3)

NicolasBrondinBernard

Author
@NicolasBrondinBernard

Here is a complete tutorial for hosting a Ghost instance on Clever Cloud using MySQL for the database and Cellar for image storage.

Article published on 04/06/2025, last updated on 10/08/2026

📦 Prerequisites

Before you start, make sure you have:

  • A Clever Cloud account: clever-cloud.com
  • Your Github account linked to your Clever-Cloud account
  • Git installed on your machine (obviously)

👻 Create a local Ghost instance

To start, we're going to create a Ghost instance directly on our machine. First you need to install the CLI:

npm install ghost-cli@latest -g

Then you'll create a folder for your project, and use the CLI to initialize Ghost:

mkdir ghost-app
cd ghost-app
ghost install local

📁 Prepare the GitHub repository

First create a repository on GitHub, and get the repository's .git url from the interface. Then all that's left is to initialize Git in your local folder:

git init
git remote add origin https://github.com/...

⚙️ Create the configuration file

Ghost uses a config.production.json file. Since Clever Cloud provides secrets via environment variables, create a template:

config.production.template.json

{
  "url": "${URL}",
  "cdn": "https://${CELLAR_ADDON_HOST}/${CELLAR_BUCKET}",
  "server": {
    "host": "0.0.0.0",
    "port": 8080
  },
  "database": {
    "client": "mysql",
    "connection": {
      "host": "${MYSQL_ADDON_HOST}",
      "user": "${MYSQL_ADDON_USER}",
      "password": "${MYSQL_ADDON_PASSWORD}",
      "database": "${MYSQL_ADDON_DB}"
    }
  },
  "storage": {
    "active": "s3",
    "s3": {
      "accessKeyId": "${CELLAR_ADDON_KEY_ID}",
      "secretAccessKey": "${CELLAR_ADDON_KEY_SECRET}",
      "region": "us-east-1",
      "bucket": "${CELLAR_BUCKET}",
      "endpoint": "https://${CELLAR_ADDON_HOST}",
      "assetHost": "https://${CELLAR_ADDON_HOST}/${CELLAR_BUCKET}",
      "forcePathStyle": true
    }
  },
  "paths": {
    "contentPath": "content/"
  }
}

Add a script in package.json

"postinstall": "cd current && npm install --legacy-peer-deps && cd .. && envsubst < config.production.template.json > config.production.json"

The postinstall command is executed directly after npm install

Here it will let us install all the dependencies needed by Ghost (not installed from the root package.json), and generate the configuration file from the previous template and the environment variables!

🧩 Install the S3 adapter

In the project directory, install the Ghost-compatible S3 adapter:

npm install ghost-storage-adapter-s3 --save

Create the content/adapters/storage/s3.js file:

const S3Storage = require('ghost-storage-adapter-s3');
module.exports = S3Storage;

🛠️ Create the application on Clever Cloud

  1. Log in to your Clever Cloud console.
  2. Create a new application from a Github repository
    1. Select your Github repository from the list
  3. Give the application a name (e.g. ghost-app).

🗄️ Add the add-ons

In the Add-ons section:

  • Add a MySQL add-on.
  • Add a Cellar add-on (S3-compatible storage).

Once added, you'll have access to the following environment variables:

  • MYSQL_ADDON_HOST, MYSQL_ADDON_USER, etc.
  • CELLAR_ADDON_KEY_ID, CELLAR_ADDON_HOST, etc.

Once the Cellar add-on is deployed, you'll need to create a bucket with whatever name you want.

Then, you'll need to add your bucket name directly into your application's environment variables, calling it CELLAR_BUCKET!

You'll also need to add your application's domain in a URL variable!

🚀 Deploy

All that's left is to add all your files to your Git repository, commit and push it all:

git add .
git commit -m "Initial Ghost setup for Clever Cloud"
git push origin main

Clever Cloud will automatically run the build and launch Ghost on port 8080.

✅ Verification

  • Access your Clever Cloud URL (or custom domain).
  • Upload an image via the Ghost admin.
  • Check that the image URL points to Cellar, not AWS.

Finished reading this article?
Our newsletter

No spam. Only free content, news, and ever more resources to level up your skills!

Join +1500 developers

Comments (0)

to leave a comment

No comments yet