Set up a blog with Ghost

Set up a blog with Ghost

Jan 17, 2021ยท

3 min read

Play this article

Let's say you are doing freelance work for a client who wants to launch a blog. While Hashnode is great, it's probably not adapted in every case. Especially for non-developers and if you need high customization also.

Here I propose to deploy a blog using Ghost.


Ghost is running on Node.js, it is a modern and very straightforward solution to anyone willing to start a blog. The Ghost developers also offer hosting on their website, if you want more info:

Now here is the process. First, we create a folder blog and a script Then we run the script.

mkdir /blog && cd /blog
echo docker run -d --name ghost -p 2368:2368  -e url= -v /blog/content:/var/lib/ghost/content --restart=always ghost:alpine >
chmod +x

Finally, have a server in Nginx in front of it:

server {

    location / {
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   Host      $http_host;

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

server {
    if ($host = {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    listen 80;
    return 404; # managed by Certbot

You can notice I use Certbot, if you don't know about Certbot, check my article:

Now you can visit and see your blog in action.

Photo by Tandem X Visuals on Unsplash

Did you find this article valuable?

Support Sonny Alves Dias by becoming a sponsor. Any amount is appreciated!