Ghost v1.0 was announced in July 2017. You can find more info about it @ In this blog, I would like to provide steps for running Ghost v1.x blog on App Service Linux.

Check my previous blog for using older version of Ghost on Azure App Services(windows).

Azure App Service is a PAAS solution to run Enterprise-grade Web Applications. Azure has recently announced App Services on Linux. It supports running web apps natively on Linux using Docker Technology.

Below is an Architecture of how a request flows through

Ghost Blog Architecture

As you can see in above screenshot, each app would have two different containers and a persistent storage between them

  • App Container (Your Application runs in this)
  • Kudu Container (Used mainly for tooling purpose like Continuous Deployment)

We would store all our Ghost_Content and log files inside /home folder as anything else would be lost after app restart

You can find Ghost Docker Image details used in this blog at below links
Github Link :
Docker Hub :

Feel free to open issues @ or Fork the repo to fit your needs.

Installation Steps

  • Click on below button and it would navigate you to azure portal
    Azure Deploy

  • Enter required details in form. It would create Azure Database for MySQL and Web App with Ghost blog installed in it.

  • Navigate to your newly created webapp in portal and click on Browse

  • First request would take little longer and might fail if it takes > 240 sec. Subsequent requests should be faster.

Why is my first request slow ?

During first request, we would run docker run command that would pull image from Dockerhub and executes script

  • would copy ghost_content folder to /home/site/wwwroot and runs database migration using knex. This part happens only once and for subsequent app restart it would spend time only for docker run command. Check to understand logic involved.


There are mutliple ways to configure Ghost application but recommended approach is to use ghost-cli. At the end, All approaches would boil down to config.production.json file in /var/lib/ghost folder. We are setting common config values using app settings provided in webapp via ghost-cli. Below is my blog config file

  "url": "",
  "server": {
    "port": 2368,
    "host": ""
  "database": {
    "client": "mysql",
    "connection": {
      "host": "",
      "user": "XXXXXXX@XXXXXXX",
      "password": "XXXXXXX",
      "database": "XXXXXXX"
  "mail": {
      "transport": "Direct"
  "logging": {
    "transports": [
  "process": "systemd",
  "paths": {
    "contentPath": "/home/site/wwwroot"

If you want to add extra config, create a config.production.json folder in /home/site folder. I have added logic in to copy config.production.json in /home/site to /var/lib/ghost if it exists before runing the app.

Note: You might have to use ftp clients like filezilla to modify config.production.json file in /home/site folder

Mail Config

There are multiple mail services. You can find related doucmentation at below link

Here is how i have added Sendgrid for my blog

  • Create a sendgrid account in Azure Portal
  • Make a note of username and password
  • You can use web-ssh available in kudu container to access app container and copy config.production.json file in /var/lib/ghost to /home/site folder
  • Replace mail config in /home/site/config.production.json with below content to use Sendgrid.
  • Change from, user and pass details as per your requirement.
  "mail": {
    "transport": "SMTP",
    "options": {
      "from": "",
      "service": "SendGrid",
      "auth": {
        "user": "",
        "pass": "XXXXXXX"

Migrating from older Version of Ghost to 1.X

Below link has required info on it

Backup web app and MySQL Database

Map an existing custom DNS name to Azure Web Apps

After mapping custom domain, make sure to update your app setting to use new custom domain else all url's inside app would redirect to old url.

Upgrade Ghost

You can find available Ghost versions at below link

I have seen many users complaining about knex-migrator issue while upgrading their ghost version.

Navigate to /var/lib/ghost folder via webssh in App Container

Run below command

ghost update

Even though you have updated your container for now.. An app restart might take it back to older version of ghost.So make sure to change tag of your docker image in Azure portal as below to upgrade after running ghost update

Example: I changed below highlighted content from 1.7 to 1.8


  • /home/LogFiles/xxx_docker.log files has docker run command and init_script output
  • /home/site/wwwroot/logs/* contains ghost application standard out/err logs

Special Thanks to Srikanth Sureddy for his contributions to Ghost image and helping me with Linux queries.