Learning How to Host Ghost
Hey, that rhymes!
Why Ghost? Ghost is a lighter weight alternative to WordPress, which would be overkill for a simple blog. Additionally, it works well with my Docker-based home lab, which runs Ubuntu Server, and is relatively easy to set up, if you do it correctly.
Process
When I first tried to set up Ghost, I attempted to use the Docker Compose installation, but it didn't publish any ports from the Docker container for some strange reason. I made sure that the ports weren't bound to any other services, but it continued to be inaccessible from the local network, with the command docker ps showing the containers were running, but not showing any published ports. I thought that it might have been an IP binding issue (possibly attaching to a loop-back address), but instead of fighting the default config, I looked for other solutions to host Ghost on Docker.
This is when I found a fantastic article from Jeremy at https://noted.lol/self-host-ghost/. This article included an alternative Docker Compose stack that properly published to port 2368, which had a nice side effect of also keeping port 80 and 443 open for other applications on my server.
Now that I had properly deployed Ghost, I simply modified the compose file to add my web domain and proxied it through Cloudflare Tunnels, like many of my other services for security and convenience (works well with dynamic IPs). With this, I had a website for my root domain to resolve to!
Pro Tips
Once I tried to sign into Ghost, it asked for a 2-factor code that was sent to my email. It wasn't set to my email because I hadn't set up the email service yet. If you have this issue, put security__staffDeviceVerification: false under the environment section in your Docker Compose to temporarily disable the 2fa. Make sure to re-enable it once you set up SMTP.
Environment Variables are used for all configuration instead of a config file when using Docker. Here is a conversion from config to environment variable.
"mail": {
"from": "[email protected]"
}Converts to
mail__from: [email protected]Make sure you use double underscores when typing the environment variable