So you're ready to start your next world changing blog. All you need is a platform to host it on right? While Medium is all the rage, you don't want to give your data and brand to someone else. You're tech savvy, so you don't want to pay someone for a platform when you can do it yourself. You could host your own Wordpress site, but do you really want that old stack for a shiny new blog?
And then you discover Ghost! A modern blogging platform built with modern libraries and a clean platform. You can self host it where you like! You can own your content and still publish easily! Its great! But where to start? How should you host it? Heroku? AWS? Well Let's take a look.
TLDR: host it on Digital Ocean using their "one click" install and follow this guide
Be sure to setup www redirect by following these instructions
Seemingly Good Options
Now, everyone likes saving money right? So you may be tempted to try and install on github pages for free hosting. Everybody likes free. Just look, there's a guide on github and the guy's own ghost site seems good.
Except, there's a problem. Besides being rather time consuming to setup and get Ghost to play nice with Buster to export static pages to work with jekyll on github pages, you can't update Ghost.
There's some pretty important stuff on the Ghost documentation that means only an installation via the CLI will be updatable:
This is the setup that Ghost CLI is intended for & tested against, and is the only setup that we guarantee will work out of the box. Ghost CLI is designed to be extensible in the near future, however if you choose to use alternatives to our recommended stack you should expect to have to debug & fix problems yourself.
Auto-installers such as Softaculous are not supported. They generally set Ghost up incorrectly and make it impossible to upgrade later. We don't recommend using them.
That's rather unfortunate. When you install on github pages its just unzipping the files, no CLI It also means even if you get fancy and install on Heroku following this guide or a "1 click deploy" solution you're going to be out of luck.
While these solutions will work, your platform now is static, and rather difficult to fix bugs, update, or really change anything. The normal ghost CLI commands will not work, and you would have to back up all your data, download a new version of ghost, and redo the setup if you want to update.
For some, it may be fine to just have a one and done solution. However, if you really want to grow this platform that has all your content, you really want to be able to update that platform as well. We all know software updates, and the web is a wildly changing place, so I really think its rather foolish to build a blogging platform of any size on a platform that cannot easily grow with it.
So, that leaves just official installations, on supported server hosting following the very long instructions ghost provides. While I'm sure any of these would work, it seems very involved. Wouldn't it be great if there was a quick official solution that supports the Ghost CLI?
The Easy One
Turns out there is at Digital Ocean, Ghost's recommended hosting provider. As I mentioned at the top summary, they actually have a pre-configured Ghost setup that will make your life much easier. There's still some steps involved, but just follow these steps and in no time you'll have a sweet official hosted Ghost site for less than $5 per month. There are no free solutions, other than a Linux box in your basement, that I know of.
This is how I have my site hosted, and I'm really happy with it. Let me know what you think and how it goes! Happy Ghost hosting.
A good reminder for the path for ghost if you need to do maintenance
One quick addendum: you may notice following the instructions above don't set www redirect or other multiple domains which you may need. To solve that, follow these instructions or read below.
SSL for additional domains
You may wish to have multiple domains that redirect to your blog, e.g. to have an extra TLD or to support www. domains. Ghost itself can only ever have one domain pointed at it. This is intentional for SEO purposes, however you can always redirect extra domains to your Ghost install using nginx.
If you want to redirect an HTTPS domain, you must have a certificate for it. This is where letsencrypt comes in particularly handy, because who wants to pay for SSL for a redirect?!
If you want to use Ghost-CLI to generate an extra SSL setup, you can do this using a little trick, first run ghost config to change the domain. This will not restart Ghost, so the change won't be reflected.
ghost config url https://my-second-domain.com
Next, get Ghost-CLI to generate an SSL setup for you:
ghost setup nginx ssl
You've now got two domains setup with SSL. Next, change your Ghost config back before you forget.
ghost config url https://my-canonical-domain.com
Finally, you'll need to edit the nginx config files for your second domain to redirect to your canonical domain. Edit both /system/files/my-second-domain.com.conf and /system/files/my-second-domain.com-ssl.conf, making two changes:
remove the first location block (leave the .well-known location block - this is used for renewing certificates.
for the redirect, you'll need to add the following as the last line of the final block:
return 301 https://my-canonical-domain.com$request_uri;
Once you have made those changes run
sudo nginx -t to get nginx to verify your config, and
sudo nginx -s reload to reload nginx and pick up your new configuration.
Also be sure the ports on ghost and nginx (look in the conf files) are listening to the same, for example
2369 as this site describes.