This blog now runs on my own VPS: Debian 13, Caddy and Hugo
After eleven years on Jekyll and GitHub Pages, this blog moved to a netcup VPS running Debian 13 'trixie', Caddy with automatic HTTPS and Hugo. How I set it up, how I locked down SSH and how a deploy now works with nothing but tar and ssh.
If you’re reading this, the move worked. This blog no longer runs on GitHub Pages. It runs on a small VPS that I rent, configure and break myself.
In 2010 this blog lived on a self-hosted WordPress at a cheap shared host. In 2015 I moved to Jekyll on GitHub Pages because I was tired of updates and spam. Eleven years later I’m back to hosting it myself, but this time with a static site and a server where I know exactly what runs on it.
Why move at all#
GitHub Pages served me well. But:
- The Ruby toolchain. Every time I wanted to write, I first had to convince Jekyll and a pile of gems on my laptop to cooperate. I complained about this in February 2025. It didn’t get better.
- I wanted to own the whole path. Domain, server, web server, build. No magic.
- The homelab made me brave. After three years of running services at home, a single public server with a single static site no longer felt scary. Just a bit exciting.
The pieces#
- A small netcup VPS in a German datacenter. Absurdly much for static HTML, and still cheaper than a pizza a month.
- Debian 13 “trixie”, released in August 2025. Boring, stable, and I know where everything is.
- Caddy 2 as the web server, mainly because it handles HTTPS on its own.
- Hugo as the static site generator, replacing Jekyll. One binary, no runtime, builds this whole blog in well under a second.
First things first: locking down SSH#
A fresh VPS gets login attempts within minutes. The very first job was making sure SSH only accepts keys.
I created a normal user with sudo rights, so I’d never need to log in as root again. Then, on my laptop, a fresh ed25519 key, copied to the server:
# on the laptop
ssh-keygen -t ed25519 -C "domien@laptop"
ssh-copy-id -i ~/.ssh/id_ed25519.pub [email protected]
# this should now only ask for the key's passphrase, not the account password
ssh [email protected]
Only once that worked did I touch the SSH daemon. On the server, in /etc/ssh/sshd_config:
PasswordAuthentication no
KbdInteractiveAuthentication no
PermitRootLogin no
One Debian gotcha: the main config starts with Include /etc/ssh/sshd_config.d/*.conf, and for most options sshd uses the first value it finds. A drop-in file in that directory that says PasswordAuthentication yes silently wins. So check what sshd actually ends up with, then validate the config and reload:
sudo sshd -T | grep -Ei 'passwordauthentication|permitrootlogin'
sudo sshd -t # no output means the config is valid
sudo systemctl reload ssh # on Debian the unit is called ssh, not sshd
And now the most important step, the one that has saved me more than once: keep the current session open and test with a second one. Open a new terminal and log in again. Also check that passwords really are refused:
ssh [email protected] # should work, with the key
ssh -o PubkeyAuthentication=no [email protected]
# [email protected]: Permission denied (publickey).
Only when both behave do you close the first session. If you lock yourself out, that open session is your only way back in that doesn’t involve a rescue console. Jef taught me that in 2011, after I’d locked myself out of a client’s server with a typo in an Apache config. Different daemon, same lesson.
After that: a firewall that only allows SSH, HTTP and HTTPS in, and unattended-upgrades for security updates. Nothing fancy.
Caddy and automatic HTTPS#
Caddy and Hugo are both in the Debian repositories, and trixie’s versions are recent enough for a simple theme:
sudo apt install caddy hugo
sudo install -d -o deploy -g deploy /var/www/blog
The deploy user owns the web root; Caddy only needs to read it. The whole /etc/caddy/Caddyfile:
domienator.com, www.domienator.com {
root * /var/www/blog
encode zstd gzip
file_server
}
That’s it. Five lines. Once the DNS records for domienator.com and www pointed at the new server, I ran sudo systemctl reload caddy, and within a few seconds Caddy had requested certificates from Let’s Encrypt, set up the redirect from HTTP to HTTPS and started serving. Renewals happen by themselves.
I remember spending a whole night in 2014 replacing certificates by hand after Heartbleed. Today I typed a domain name in a text file. Progress is real, sometimes.
From Jekyll to Hugo#
The migration was less work than I feared. The posts were already Markdown with front matter. I wrote a small script to normalise the front matter (dates with time zones, tags, summaries) and kept the URLs the same so old links don’t break. The theme I rewrote from scratch: a few templates, one stylesheet, no JavaScript framework. In 2023 I wrote that boring technology is a feature. I meant it.
Comments are gone. Disqus had been on my list of things to get rid of for years, and real comments had dwindled to a handful a year. Email still works.
Deploying: tar over SSH, build on the server#
No CI, no container registry, no git hooks. A deploy is one script on my laptop:
#!/usr/bin/env bash
set -euo pipefail
SRC="$HOME/src/blog"
REMOTE="[email protected]"
tar -C "$SRC" --exclude='./public' --exclude='./resources' --exclude='./.git' -czf - . \
| ssh "$REMOTE" 'set -e
rm -rf ~/blog-src && mkdir -p ~/blog-src
tar -C ~/blog-src -xzf -
hugo --source ~/blog-src --minify --cleanDestinationDir --destination /var/www/blog'
It packs the source into a tarball, streams it over SSH, unpacks it in a fresh directory on the server, and lets Hugo build straight into the web root. The deploy user has its own ed25519 key and no sudo.
Why build on the server instead of locally? Because then there’s exactly one Hugo version that matters: the one on the server. I can deploy from any machine that has tar and ssh, which is every machine I own, including the old laptop that never had Ruby working properly.
Is it atomic? No. For a fraction of a second during a build, a file might be missing. For a personal blog I can live with that. If it ever bothers me, I’ll build into a timestamped directory and switch a symlink.
What it costs, and what’s next#
A few euros a month for the VPS, plus the domain. Less than the shared host I paid for in 2010, with considerably more server.
On the list: off-site backups of the server config, and alerts from the Uptime Kuma at home that already watches it.
Segfault supervised the whole migration from the warm top of the mini PC. He missed the first four years of this blog, but he’s been around for most of the rest. Allez, see you on the new server.