Ghost

Ghost CMS is a popular open-source content management system that is specifically designed for bloggers and writers. In this blog post, we’ll explore the pros and cons of Ghost CMS, compare it to WordPress, and highlight its unique features that make it a top choice for content creators.

We’ll also show you how to install Ghost CMS with Docker and expose it safely to the internet with Cloudflare Tunnel.

Why using Ghost as CMS?

  • User-Friendly: Ghost CMS has a simple and intuitive user interface, making it easy for users to create and manage their content.

  • Customization: With a wide range of themes and plugins available, Ghost CMS provides ample customization options for users. The platform also has a built-in editor that supports Markdown and HTML, giving users more control over their content.

  • SEO-Friendly: Ghost CMS is designed with SEO in mind, with built-in optimization tools and the ability to create custom URLs and meta descriptions.

  • Speed: Ghost CMS is built to be fast, with a focus on minimalism and performance. This means that websites built on Ghost CMS load quickly, providing a better user experience.

You should also be aware that:

  • Limited Functionality: While Ghost CMS is great for blogging and writing, it may not be the best choice for complex websites or e-commerce sites.

  • Smaller Community: Compared to platforms like WordPress, Ghost CMS has a smaller community and fewer resources available for support and troubleshooting.

Ghost versus Wordpress

While both Ghost CMS and WordPress are popular content management systems, there are some key differences between the two.

  • User Interface: Ghost CMS has a simpler and more streamlined user interface, while WordPress has a more complex and customizable interface.

  • Focus: Ghost CMS is focused on blogging and writing, while WordPress can be used for a wider range of websites and applications.

  • Performance: Ghost CMS is built for speed and performance, while WordPress can be slower due to its more complex nature and reliance on plugins.

Installing Ghost with Docker

The docker image that we are going to use to deploy Ghost:

Ghost: Locally with Docker Compose

version: '3.1'

services:

  ghost:
    image: ghost:4-alpine
    restart: always
    ports:
      - 8088:2368
    environment:
      # see https://ghost.org/docs/config/#configuration-options #make sure to change these!
      database__client: mysql
      database__connection__host: db
      database__connection__user: root
      database__connection__password: example
      database__connection__database: ghost
      # this url value is just an example, adjust it properly!
      url: http://yourlocalip:8088
      # contrary to the default mentioned in the linked documentation, this image defaults to NODE_ENV=production (so development mode needs to be explicitly specified if desired)
      #NODE_ENV: development

  db:
    image: linuxserver/mariadb #mysql:8.0
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: example

After the deployment is completed, you will be able to check your working instance of Ghost at: http://yourlocalip:8088 and yourlocalip:8088/ghost/

Ghost with NGINX and Docker Compose

If you are interested to exposed the service to the internet, you will want to run uptime kuma behind a NGINX proxy. Follow this steps:

version: '3.1'

services:

  ghost:
    image: ghost:4-alpine
    restart: always
    ports:
      - 8088:2368
    environment:
      # see https://ghost.org/docs/config/#configuration-options #make sure to change these!
      database__client: mysql
      database__connection__host: db
      database__connection__user: root
      database__connection__password: example
      database__connection__database: ghost
      # this url value is just an example, adjust it properly!
      url: https://subdomain.yourdomain.com
      # contrary to the default mentioned in the linked documentation, this image defaults to NODE_ENV=production (so development mode needs to be explicitly specified if desired)
      #NODE_ENV: development
    networks:
       - nginx_default  

  db:
    image: linuxserver/mariadb #mysql:8.0
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: example
networks:
    nginx_default:
       external: true        

IMPORTANT: make sure to change the default passwords in the configuration file before deploying and exposing it to the internet.

  • Step 3: Finish the setup in NGINX UI as covered in its guide.

Ghost with Cloudflare Tunnel and Docker Compose

First, get familiar with the Cloudflare Docker setup, as covered during the guide to expose your services securely with Cloudflare Zero Trust Tunnel.

Once you have that ready, simply use the tunnel network that connects our matrix-synapse instance to the Cloudflare tunnel during the installation with docker-compose:

version: '3.1'

services:

  ghost:
    image: ghost:4-alpine
    restart: always
    ports:
      - 8088:2368
    environment:
      # see https://ghost.org/docs/config/#configuration-options #make sure to change these!
      database__client: mysql
      database__connection__host: db
      database__connection__user: root
      database__connection__password: example
      database__connection__database: ghost
      # this url value is just an example, adjust it properly!
      url: https://subdomain.yourdomain.com
      # contrary to the default mentioned in the linked documentation, this image defaults to NODE_ENV=production (so development mode needs to be explicitly specified if desired)
      #NODE_ENV: development
    networks: ["tunnel"]

  db:
    image: linuxserver/mariadb #mysql:8.0
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: example

networks:
    tunnel:
        external: true     

Remember to go back to the one dash cloudflare UI:

  • Add a Public Hostname in the Cloudflare web UI
    • Select the desired subdomain, domain and path (where applicable)
    • Then, add proxy host for example: ghost:8088

After this step, your service is already protected with HTTPS and accesible through the internet in the desired subdomain.yourdomain.com

FAQ

How to Deploy Nginx Proxy Manager

If you are interested in deploying a separated NGINX instance with Docker, I already created a guide for that here.

How to Configure Cloudflare Tunnel with Docker

Check this guide if you are interested to know how to safely deploy services through Cloudflare Zero Trust Tunnels.