I have been wanting to start my personal blog for a while. And after weighing the pros and cons of the different options, I have finally decided to use Ghost for my personal blog, running on a cloud VM on Google cloud.
Although ghost.org offers fully managed Ghost infrastructure, it was too expensive for a personal blog as the pricing starts from 29$/month. Besides, I really like getting my hands dirty so I also opted most of the one click installations.
I have decided to use Docker to run the blog stack (Ghost + MariaDB + Nginx) to be able to spin up the blog easily, and also to be able to replicate the same setup locally or anywhere else when needed. In order to achieve this, I have created the khan/docker-ghost github repository to make it easier to deploy the blog.
Register a domain name
First you need to choose and register a domain name for your blog. There are multiple domain name registrars to choose from such as GoDaddy, namecheap or names.co.uk. I chose to register my domain with names.co.uk because that's where I get free for first year. GoDaddy also offer £0.99 for first year but you have to pay for 2 years(depends on the domain name).
Provision a cloud instance
I chose to deploy the stack in Google cloud platform as its give $300 free credit for a year. Since this is just personal blog, I wasn't expecting much traffic so their E2 compute instance would be sufficient.
Since everything will be running on Docker, the only dependencies needed are docker and docker-compose which they can be installed using the command below
You also need to make sure that your non-root user is in the docker group to be able to run docker commands:
Preparing the environment
First, you need to clone the github repository on your machine:
The .env files provided in the github repository contains default configuration which can be used for running ghost locally. However, for running a public blog it must be changed accordingly.
The environment variables defined above are used by docker-compose to configure the Docker containers during (re)creation:
The folders are created by default under the home directory, and this default Nginx configuration would be used:
In order to deploy ghost, you just need to run the run.sh script provided in the github repository:
You can see that the containers are now up and running:
By navigating to your VM's public IP address or to http://127.0.0.1 (if you are running ghost on your local environment), you should now be able to access your new ghost blog: