2 min read

How I set up my new site

Here's how I set up my new site

Ghost is a really cool publishing platform that I decided would be the right fit for my site, here's how I set it up using docker-compose

Prerequisites

Podman

Podman is a Docker alternative that can also run Docker containers. Installing Podman and its Docker compatibility is as easy as running the following command on Ubuntu:

sudo apt install podman podman-docker
installing podman and podman-docker

Docker Compose

Docker Compose is an easy and simple way to make reproducible containers that can be easily run. To install docker-compose, run the following command:

sudo curl -L --fail https://github.com/docker/compose/releases/download/1.29.2/run.sh -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
installing docker-compose

Setting up the container

In a new folder, make a file called docker-compose.yml with the following content:

version: '3.1'

services:

  ghost:
    image: ghost:4-alpine
    restart: always
    ports:
      - 2368:2368
    volumes:
      - '/home/ubuntu/ghost/data:/var/lib/ghost/content'
    environment:
        url: https://example.com

Make sure to replace example.com with your domain, in my case, wgyt.tk. After that, you can start the container with the following command:

sudo docker-compose up -d

Setting up Ghost

Once the site works, go to the url of the site followed by /ghost, in my case I'd go to wgyt.tk/ghost. You'd follow the initial setup process, then set up the general settings as you'd like.

Themes

For my site, I considered many themes, until deciding to make my own fork of the dawn theme, which you can download here. In the settings page, go to the design tab, then the change theme UI, click upload theme and upload the zip file of the theme. You can then change the brand settings to whatever you'd like.

Membership and newsletters

For a small blog like mine, I knew that membership and newsletters wouldn't help me in any way. I disabled membership features by going to the settings page, the membership tab, and setting subscription access to none. I also disabled newsletter features by going to the settings page, the email newsletters tab, and disabling "Enable newsletter sending".

Setting up a custom domain using Cloudflare Tunnels

The last step was setting up a custom domain, while there are many ways to do this, I use Cloudflare Tunnels as it is an easy way to expose an application without using port forwarding. I won't cover how to set up and run Cloudflare Tunnels in this post, as Erisa has an amazing tutorial about setting up Cloudflare Tunnels here. Here is the config file that I use to host this site:

tunnel: uuid
credentials-file: /etc/cloudflared/uuid.json

ingress:
  - hostname: beta.wgyt.tk
    service: http://localhost:2368
  - hostname: wgyt.tk
    service: http://localhost:2368
  - service: http://localhost