Skip to content

Ghost Β· deploy guide

Deploy Ghost (blog & newsletter) with Docker Compose

Publish a Ghost blog on bashrack web hosting with MySQL, persistent content and automatic SSL on your own domain.

about 15 minutes of hands-on time

Who it's for

Writers and companies who want a fast publishing platform with memberships and newsletters.

You'll need

  • A bashrack account with at least $5 in the wallet
  • A domain, e.g. blog.example.com
  • SMTP credentials for sending staff and member emails

Steps

  1. step 1

    Create a web app from Docker Compose

    Web hosting β†’ New app β†’ Docker Compose, Medium resources and 10 GB storage.

    yaml
    services:
      ghost:
        image: ghost:5-alpine
        restart: unless-stopped
        environment:
          url: https://${GHOST_DOMAIN}
          database__client: mysql
          database__connection__host: db
          database__connection__user: ghost
          database__connection__password: ${DB_PASSWORD}
          database__connection__database: ghost
        volumes:
          - ghost_content:/var/lib/ghost/content
        depends_on:
          - db
      db:
        image: mysql:8.0
        restart: unless-stopped
        environment:
          MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
          MYSQL_DATABASE: ghost
          MYSQL_USER: ghost
          MYSQL_PASSWORD: ${DB_PASSWORD}
        volumes:
          - ghost_db:/var/lib/mysql
    volumes:
      ghost_content:
      ghost_db:
  2. step 2

    Set the environment variables

    Use long random passwords (for example from openssl rand -hex 24).

    ini
    GHOST_DOMAIN=blog.example.com
    DB_PASSWORD=<random>
    DB_ROOT_PASSWORD=<random>
  3. step 3

    Add your domain and deploy

    Point https://blog.example.com at the ghost service on port 2368 in the Domains tab, deploy, then open /ghost on your domain to create the owner account.

  4. step 4

    Configure email

    Add Ghost's mail__ environment variables for your SMTP provider so staff invites and member sign-ups can be delivered.

Security and upkeep

  • Create the owner account at /ghost immediately after the first deploy.
  • Keep both volumes: ghost_content holds images and themes, ghost_db the posts and members.
  • Stay on the 5.x major tag and redeploy to pick up security releases.

Official documentation