You may have noticed this blog is running Ghost, one of the best blog platforms in the world. But what if I told you I'm hosting this blog for free. Really, I'm paying
$0 for this blog. Wanna know how I did it and build your own? Follow along!
There are three main hosting options: you can use Ghost's own hosting, use a DigitalOcean droplet or use Heroku. For this blog, I decided to go with the cheapest option: Heroku.
Deploying Ghost to Heroku is very simple: Just click the button above, fill in the name and URL and click Deploy. Here's a quick GIF to illustrate the process:
Configuring your blog
After your app finishes its first deploy (should take around two minutes), you'll be redirected to your blog's admin where you'll be guided on the rest of the setup (naming the blog and creating an admin user). At this point, we already have our blog up and running but with a limitation: we're using a
herokuapp.com subdomain. Let's see how we can fix it.
Heroku offers free custom domains once you verify your account. This means that, if you add a credit card to your heroku account, you'll be able to configure a custom domain for your blog. Fortunately, the entire process is free and you won't be billed but you'll have to take care of what you do from now on.
Anyways, access your blog from your Heroku dashboard and go to the settings tab. If you scroll down, you'll find a section called Domains and Certificates where you can add a custom domain. After pointing your DNS to Heroku, you'll also have to update your
PUBLIC_URL variable. To do this, scroll back up and click on the Reveal Config Vars button then find the
PUBLIC_URL variable and change it to point to your new domain. After you've done this, restart all your dynos. Here's another GIF:
Keeping your dyno up
In the Heroku free plan, dynos (the programs that serve your blog) are disabled when there are no requests to your blog and enabled again on new requests. While you might not have any issues with this, I didn't want my readers to wait for some extra seconds so I took advantage of my status page and created a component that monitors this blog every five minutes both checking for downtime and keeping my dynos running. If you want, you can get a similar solution using UptimeRobot or any other uptime checker service.
While my setup may work for me, you'll have to check if Ghost's official hosting or DigitalOcean works better for you. After all, every setup is different.
Subscribe to Miguel Piedrafita's Blog
Get the latest posts delivered right to your inbox