How to Host a Ghost Blog for Free on

How to Host a Ghost Blog for Free on
Photo by Drew Tilk / Unsplash

Ghost is an amazing platform for content creators with tons of features to enable blogging, newsletters and subscriptions. Most importantly, it’s a pleasure to use. If you’ve ever felt the urge to gouge our your own eyeballs after trying to use WordPress, you should definitely give Ghost a try!

If you’ve ever felt the urge to gouge our your own eyeballs after trying to use WordPress, you should definitely give Ghost a try!

If you want to get started with Ghost, they offer a fully hosted version starting at $9 a month. But because the project is fully open-source, you also have the option of hosting it yourself for free. While I believe Ghost is a product worth supporting with the paid plan, the free option is great for getting up and running with a new site. is an amazing app deployment platform that makes it easy to deploy your apps in multiple regions around the world, close to your customers. Their excellent command-line tools make it simple to configure and deploy applications in a predictable, reproducible way.

In this post, we’ll learn how to setup a Ghost blog using the platform for free.

What We’re Going to Do

In this post, we’ll go through the following steps:

  • Install the Fly command-line tools
  • Create a free account
  • Deploy an app using a pre-made image of the Ghost blogging platform
  • Setup and configure storage for Ghost to store our data in a sqlite3 database
  • Deploy our app!
  • Setup a custom domain name

Let’s get started!

Install the Command-Line Tools

The very first step in getting started with is to install the command- line tools. You can do so by running:

curl -L | sh

Or, if you’re on a Mac running Homebrew, you can also install it like this:

brew install flyctl

Create an Account and Login to

Now that we’ve got the CLI tools installed, we can create and login to our account using the command:

flyctl auth login

This command will open up a browser window to let you create and/or login to an account. I recommend authing with your GitHub account to make the process simple.

After you’ve logged in successfully in the browser, you should be able to return to the command-line. Your authentication session is automatically saved.

Create Your App

Next, we need to create an app with Fly, and configure it to use a ready-made Docker image of Ghost:

mkdir my-blog
cd my-blog
flyctl launch --image=ghost:5.17.2 --no-deploy

We’re using a Docker image of Ghost version 5.17.2, which is as of the time of this writing, the latest version. If you want to check that this is still the latest version, have a look at Docker Hub. Be aware though, that changing image versions may require different setup instructions than what’s described in this post.

After entering the command, follow the instructions given on the command-line. For the app name, choose one or let Fly choose one for you, but take note of it — you’ll need it later. When asked about which region you’d like to deploy to, simply pick one that’s closest to your audience!

You’ll note that we included a --no-deploy flag in our command. That’s because we’re not quite ready to deploy and launch the app yet, we’re just setting up the configuration. The result of this command will be our Fly configuration file fly.toml. We’ll make a couple of changes there before we deploy.

Create Storage for our Database

Next, we’ll need to create some persistent disk storage to hold our content:

flyctl volumes create data -s 3

Choose the same region you chose in the previous step. When this is done, we’ll have a 3GB volume called data that we can connect to our application instance.

Update Your Fly Config

Now we need to make some changes to our fly.toml config. We need to configure 1) the hostname 2) the database 3) where to mount our disk volume and 4) the port number.

Here are the relevant sections of the configuration. Note that you need to merge the configuration below with the rest of the configuration in each section, don’t just replace all of the existing config!

  url = ""  
  database__client = "sqlite3"  
  database__connection__filename = "content/data/ghost.db"  
  database__useNullAsDefault = "true"  
  database__debug = "false"

  internal_port = 2368

Deploy Your Blog!

Now that you’ve gotten your app configured, you can deploy it by simply running:

flyctl deploy

This process may take a minute or two, but in the end, you should have your blog deployed at

Navigate to to setup your account and administer your new blog!

Optional — Set a Custom Domain

This step is optional, but if you want to, you can configure a custom domain name, instead of just Setting up the custom host will require that you have DNS access to your custom domain.

When you’re ready, you can add your domain with the following commands:

fly domains add
fly certs add

After adding the cert, you should see some output like this:

You are creating a certificate for
We are using lets_encrypt for this certificate.

You can direct traffic to by:

1: Adding an A record to your DNS service which reads


You can validate your ownership of by:

2: Adding an AAAA record to your DNS service which reads:


Be sure to follow the instructions here and set up the two DNS records! Your domain will not work until they are setup. Additionally, be prepared that it can take about 15 minutes or more to verify and issue the cert.

You can check the status of the cert with the command fly certs list and fly certs show

Optional — Configure Your Transactional Mailer

If you plan on using some of the email features of Ghost, you’ll want to setup your email configuration.

For bulk emailing, you will need to setup Mailgun in the Ghost admin, but to get simple transactional emails working (notifications, signup confirmations), you can do so with any valid SMTP configuration:

  mail__from = "..."  
  mail__transport = "SMTP"  
  mail__options__host = "..."  
  mail__options__port = ...  
  mail__options__auth__user = ...  
  mail__options__auth__pass = ...

The Final Step — Enjoy!

If you’ve run all these commands successfully, you should have your new blog up and running. Navigate to and start building your content!