Self-hosting
The services I use every day, run on my own machines with free software, so my data stays mine and I can always move.
The machines
A handful of servers: a few VPSes at European hosting companies for what has to be reachable from anywhere, and at home a Proxmox VE hypervisor with its guests and a small server that holds the backups. They, my desktop and my development VMs all run Debian.
All of it as code
No server is set up by hand. Every machine is described in one Git repository and configured by Ansible: users, SSH, firewall, updates, mail, backups and the containers each one runs. Infrastructure as code means a rebuilt server comes back the same, and every change is a commit I can review and undo.
The services run as containers with Docker Compose. My own apps, this site among them, are PHP on FrankenPHP.
Files
OpenCloud keeps my files and syncs them between my devices, instead of Dropbox or OneDrive.
Photos
Immich backs up the photos from our phones and finds one by face, place or what is in it, instead of Google Photos.
Passwords
Vaultwarden, a lean server for the Bitwarden apps, holds the passwords.
Tasks
Vikunja keeps the to-do lists and projects.
Code
Forgejo hosts my Git repositories and its container registry, and its Actions build, test and deploy them: this site, EMS and the price API go live from there.
Sign-in
Pocket ID gives everything one sign-on with a passkey, over OpenID Connect; OAuth2 Proxy puts it in front of the apps that cannot speak that themselves.
The front door
Caddy answers every web request, with certificates from Let’s Encrypt, and passes each to its service. In front of the apps it runs Coraza, a web application firewall with the OWASP Core Rule Set, and CrowdSec bans the addresses that keep trying.
Underneath, nftables lets in only what each machine serves, OpenSSH takes keys only, and containers that need the internet go out through a Squid proxy that knows where they may go.
Updates and monitoring
Debian’s unattended upgrades install updates by themselves, and reboot only when one needs it. Diun tells me when a container image has a new release; my own images update each morning.
Beszel watches every machine and container, and Postfix sends what the servers have to say to my mailbox.
Two watchers sit outside, so they still speak up when my own machines cannot: every backup job reports to Healthchecks.io, which tells me when one fails or does not run at all, and UptimeRobot checks from the internet that the VPSes are up and answering.
One place for the logs
Everything logs to the systemd journal: the services, the containers through Docker’s journald log driver, and Caddy’s access log. Every machine sends its journal with systemd-journal-upload to a log store I wrote myself, which keeps the last weeks in SQLite with a full-text index, and masks passwords and tokens on the way in.
Its web viewer, behind the same single sign-on, searches, filters and follows all machines at once, charts the volume over time, and for a refused request explains why: which WAF rule or CrowdSec ban stopped it. It mails me when a machine goes quiet, or when its errors or refused requests suddenly pile up.
Backups
Every server is backed up twice, with two different tools, so one bug cannot take out both: borgmatic with BorgBackup, encrypted, to storage at another provider, and rsnapshot to the server at home. That one pulls the backups with read-only access, so a server that is broken into cannot delete its own history.
The virtual machines at home go to Proxmox Backup Server, and the photos and passwords have a standby copy at home that can take over.
What I don’t run
Mail stays with Fastmail: running a mail server well is a job of its own, and I would rather spend the time on the rest. Nor is any of this a product: it is my own setup, shared to show what is possible. If you are thinking of doing the same, get in touch.