To get this blog up and running, I followed the instructions in Alex Ellis' blog entry "Run your blog with Ghost, Docker and LetsEncrypt". A summary of what I had to do, follows.
- Choose and setup my cloud server.
- Choose and setup my own domain name and DNS provider.
- Install what is needed (ufw, Nginx, certbot, Docker and Ghost).
- Obtain HTTPS certificates.
- Configure and start Nginx, Docker and Ghost.
- Setup Ghost.
(1) I chose Digital Ocean as my cloud provider and Linux Ubuntu as server OS. To enable ssh to my server, I needed to setup my ssh keys on my laptop as well as on my Digital Ocean account. As soon as I had these installed, I was able to ssh login to my server. This step was easy. I needed my credit card.
(2) As my domain name registrar and name server provider I selected Zoner. I had to select a Finnish company, as I wanted my blog domain name to have .fi suffix. The hard part was to choose the name – which I will perhaps explain in some later post. Using Zoner's self service portal, I then added my cloud server's IP name and address to Zoner's DNS servers. After a short while, my server's name and address was known to the Internet. I was billed later.
(3) Install and configure all the needed software:
- ufw – firewall
- Nginx – web server
- certbot – for obtaining the HTTPS certificates from LetsEncrypt
- Docker – containers
- Ghost Docker image – blog platform
This was easy and quick to do, as Alex explains all the commands for installation and configuration in his blog. The configuration of Nginx is done in two phases, first to obtain the HTTPS certificates, and there after to serve the actual blog.
At this point, I was able to see my blog server's Nginx default home page using my browser, but with plain HTTP only.
(4) Obtain HTTPS certificates from LetsEncrypt: Running certbot asks for my blog address and then creates the key pair for my site. Quick and easy to do – and free of charge. The downside is that later I need to renew the certificates every three months.
At this point I have the HTTPS certificates and I am ready to continue to phase two of Nginx configuration as well as configuring and starting Ghost.
(5) Obtain the Docker image for Ghost, configure the parameters and start the image. When done, I was supposed to see my site using the browser. But I did not. I had HTTPS on, but my server responded with the nginx default page (and not the Ghost default page).
So I did have to do some troubleshooting. Looking in to the log files and after some Google searching, I found two issues:
- nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument
- How to Proxy Port 80 to 2368 for Ghost with Nginx
After fixing them Ghost responded as expected and I was ready for the final step.
(6) The final step was to register myself as the admin for my blog. Then perform some basic configurations, like selecting time zone, setting the blog title and so on. Now I was ready to enter my first blog post!
In summary, I started on Sunday evening, on Monday evening I had my domain name ready, on Tuesday evening I setup the LetsEncrypt HTTPS certificates and later at night I had the blog up and running and published my first entry.
And as a reminder, I still need to:
- Implement my backup plan and also think about my exit plan.
- Finetune the blog's visual appearance and other features.
- Remember to renew my HTTPS certificates before they expire.
I am glad if this blog post encourages even one person to start implementing her or his own blog.
Thanks for reading.