In contrast to what I said in my previous post setting up a self-hosted blog is easy. It is almost so easy that I was doubting if I should write about it (or that could be my anxiety again. 😉) What do we need to for our setup:

  • A domain name (w8mr.nl for me, which I already own)
  • A place to host (For me, my NAS)
  • CMS software (After some small research I stopped at Ghost)
  • Docker host (Already running on my NAS)
  • Http2/TLS termination (NginX already running on my NAS)
  • A template (Caffeine theme, because I liked it)

Most of it was already in place for me. Via the website i found the instructions of setting it up via Docker, as most software has these days. Not all software has docker images supporting ARMv7 cpu architecture

docker run -d --restart always --name w8mr-ghost -p 2368:2368 -v /home/odroid/ghost:/var/lib/ghost/content -e url=https://w8mr.nl ghost

After this connecting to http://localhost:2368/admin gives a welcome screen. Moving forward gives a registration form and the possiblility to add Staff members. Next step is the main dashboard.

Next step is setting up the theme. Also quite easy. Just stop the container, go into the configuration directory and into the themes directory. Clone the template from the git repository. Start the container again, and in the settings of the dashboard choose the new available theme.

I followed the steps to setup Disqus as a commenting system, but after I found out that It was showing huge ads, I decided to remove it again from the template, I will have to replace this with something more open and privacy concerned.

I made some small changes to the template to make it a little bit more me. And next step would be to expose this to the outside world. I will be using my already setup Nginx to proxy traffic to the ghost container. I needed to add some configuration for this.

server {
    listen 80;
    listen [::]:80;
    server_name  w8mr.nl;
    return 301 https://$host$request_uri;
}

server {
    listen       443 ssl http2;
    ssl_certificate /etc/letsencrypt/live/r.w8mr.nl/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/r.w8mr.nl/privkey.pem;
    server_name  w8mr.nl;

    #charset koi8-r;
    #access_log  /var/log/nginx/log/host.access.log  main;


location / {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $http_host;
    proxy_pass http://192.168.1.1:2368;
}

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

}

Reloading nginx, and yes the site is visible from the outside. Last step is to remove the basic articles that are there after the installation and start writing my own articles. I do have a few optimizations in mind that I want to do, but that will have to wait till a later time and I will get back to you on that. For now please enjoy my site and drop me a comment (not on the site yet, but somewhere on social media will do.)