Ghost Blog + Nginx + Let's Encrypt
Ghost is a open source blog platform for developers and journalists. At the time of writing, this blog is powered by Ghost. It's a lot more easier to use (and with less bloatware) than Wordpress and it can be hosted on your own server.
This post is dedicated to make a brief introduction to install Ghost Blog with Let's Encrypt SSL/TLS certificates and a custom config file for Nginx.
Requirements
In order to install Ghost, you need a local server or VPS with a GNU/Linux distribution, a configured DNS domain and Node.js, Let's Encrypt certbot and Nginx installed. Instructions below are intended for Ubuntu.
Install
Let's Encrypt Certbot
My previous post shows how to install the Let's Encrypt Certbot that renews SSL/TLS credentials automatically. But in a nutshell, you can install it on Ubuntu like this (replace mydomain.info
with your own DNS domain):
Nginx
Nginx can be quicky installed with the following command (Nginx will act as a reverse proxy in order to allow access to Ghost blog from outside):
Node.js
Node.js can be installed in Ubuntu as follows:
Ghost Blog
Now you can install Ghost Blog with the following commands:
Follow the instructions of the installer, and say no to Set up NGINX?
and Set up SSL?
since we're making our custom Nginx config file for this (more detailed instructions for the installer can be seen here).
Custom config file for Ghost + Let's Encrypt for Nginx
If everrything went well with the Ghost installer, the blog will be listening over http://localhost:2368
. In order to make available to other PCs over the internet, a reverse proxy must be done. The config file shown below allows to make a reverse proxy from http://localhost:2368
to the external network using Let's Encrypt certificates for our DNS domain (as above, replace mydomain.info
with your own domain):
Save this file as /etc/nginx/sites-available/blog.conf
, with the nano editor, it can be done as follows (in nano, you can save with CTRL+O
and exit with CTRL+X
):
Now enable your new config file as follows:
If everything went well, you will be able to access your site from https://mydomain.info
.
Wrapping up
This tutorial is a brief introduction to Ghost Blog and custom configuration for Let's Encrypt. I hope you liked this post!