December 01, 2026
A few years ago I got frustrated with GitHub Pages and started hosting all my websites the “old-fashioned” way: copying files to a server somewhere. In this case, to a $6/mo virtual private server (VPS) on Digital Ocean, running Ubuntu and nginx.
I originally did this because I wanted to see my access logs, but now I just prefer the experience. One VPS easily handles the traffic for my text-and-images websites, and deployments are faster, the website loads quicker, and uptime is better. If I want to change how something works, the process teaches me how computers work, instead of how GitHub works.
In the last year, however, there have been multiple critical security notices urging me to update both Ubuntu and nginx. This is a big problem for me. I’m running my own web server because I like the results, not because I like arbitrary tasks—especially not mandatory, time-sensitive tasks. I believe that having a web presence should be as fire-and-forget as possible.
In my best imitation of a Julia Evans blog post, here’s a few things I learned while moving my websites from Ubuntu/nginx to OpenBSD/httpd.
OpenBSD is an operating system that emphasizes security and stability. Its website declares that it has had only two remotes holes in the default installation in “a heck of a long time.” OpenBSD is a Unix-like, so it broadly feels like Linux, but the core systems—including the web server, httpd, and the packet filter, pf—are developed by the same team and shipped with the operating system, so the experience feels more unified. Great!
I’ve been seeing more mentions of OpenBSD (and the sort-of-related FreeBSD and NetBSD) lately, extolling its ironclad security, simple upgrades, and detailed manuals, and I’ve always wondered what the catch is. The answer seems to be that the software and hardware support isn’t as wide. That’s not a problem for me—I only want to run a web server.
I particularly like the focus on stability, a value held by other software projects I use and admire. Stability is respectful of my time, the most important resource I have.
I rented a cheap server from Vultr, which has a one-click option to set up a VPS with the latest version of OpenBSD. Digital Ocean does not natively support OpenBSD, and I was looking to leave them anyway (for a variety of reasons). Vultr has a perfectly adequate interface that looks a lot like Digital Ocean did five years ago, which I prefer to the way Digital Ocean looks now.
Vultr is a US-based company, unlike oft-mentioned alternatives such as Hetzner or Netcup. EU-based hosting is trendy, and I understand the reasons why, but I don’t live there, and on balance I prefer doing business with companies in the same country as you.
Setting up httpd was reasonably simple. I recommend following httpd.rocks, and also reading this blog post, which walks through the same setup with more narrative detail and a stricter packet filter.
All my static websites are deployed by syncing the files to the server, using rsync.
This command syncs the local directory ./public/ to a directory on the websites server:
rsync -r --delete ./public/ websites:/var/www/unplannedobsolescence.com
My login user owns the directories inside /var/www, but they’re also part of the www group, and the web server has read-only access to them so it can serve the site.
I ran this chown command after making a directory for each site:
chown -R alex:www /var/www/$SITE_DOMAIN
OpenBSD uses openrsync, not rsync, and some commands don’t work properly with the rsync on MacOS. There are ways to fix this, but I did the much dumber thing and just installed “real” rsync on the OpenBSD machine.
pkg_add rsync-3.5.1
At some point I’d like to use openrsync, since that preserves all the nice OpenBSD guarantees mentioned above, but this works great for now.
If you are running multiple websites on the same VPS, you will quickly notice that parts of the basic httpd config are repeated everywhere. Specifically this bit, which adds a special URL for validating SSL certificates.
location "/.well-known/acme-challenge/*" {
root "/acme"
request strip 2
}
I think this clutters up the config—every HTTPS site will have two of them, three if you redirect the www subdomain.
Repetitive clutter makes it hard to see the important parts that differentiate each configuration.
To fix this, I put that snippet into its own file, acme-challenge.conf, and included it each time:
server "unplannedobsolescence.com" {
listen on * tls port 443
# ...
include "/etc/sites/utils/acme-challenge.conf"
}
server "unplannedobsolescence.com" {
listen on * port 80
block return 301 "https://$SERVER_NAME$REQUEST_URI"
include "/etc/sites/utils/acme-challenge.conf"
}
server "www.unplannedobsolescence.com" {
listen on * port 80
listen on * tls port 443
# ...
include "/etc/sites/utils/acme-challenge.conf"
}
Having to put snippets in their own file in order to re-use them is a little silly, but I couldn’t find a more elegant mechanism. The httpd config language has a feature called “macros,” but those appear to just be variables, and I’m confused why they’re called macros instead. The author of the earlier blog post built a config generation pipeline using the m4 macro processor—this is certainly interesting, but not what I would call elegant.
This same trick can be applied to easily auto-drop bots that are fishing for vulnerabilities at URLs that no legitimate web user would try to access. I include this in every one of my server configs.
location "/.env-sample" {block drop}
location "/.amplifyrc" {block drop}
location "/.env" {block drop}
location "/.aws/.env" {block drop}
location "/.aws/config" {block drop}
location "/.cursor/mcp.json" {block drop}
location "/.aws/credentials.bak" {block drop}
location "/.docker/config.json" {block drop}
# ...
Of course, you can combine these into one common config that you include everywhere.
include "/etc/sites/utils/acme-challenge.conf"
include "/etc/sites/utils/bad-urls.conf"
Managing lots of files that reference each other can get annoying, so don’t take this too far.
Most httpd configs will contain this line:
types { include "/usr/share/misc/mime.types" }
This tells httpd to automatically add the content-type header to routes that end with certain file extensions.
For example, /stylesheet.css will get the text/css header and /1040.pdf will get the application/pdf header.
Browsers use this header to determine what to do with the contents of a response.
Oddly, httpd doesn’t allow you to add new types to this list once you’ve declared them, nor can you add additional extensions underneath the include.
I have a few text files with extensions that aren’t in the default list, such as .log and .awk, so httpd serves them without a content-type header; without this header, Firefox will prompt the user to save the file, rather than opening it in a plaintext tab, which is what I want.
Prior to OpenBSD 8.0, this was resolved with awkward hacks, but with the newly-introduced header set directive, we can manually set content-type based on the route.
location "*.log" {
header set "Content-Type" "text/plain; charset=utf-8"
}
As you probably noticed, this also allows you to declare the character encoding as UTF-8. If your plaintext files are rendering strangely in the browser—missing emojis, unexpected symbols—that’s probably why.
At the time of this writing, httpd is serving you the website you’re reading, so its going well-enough I suppose.
A frustrating but unavoidable aspect of working in the software longevity space is that you won’t know for a long time whether or not your choices achieved it. If you have your eye on the hundred-year web service, you can’t spike the football after one month. Perhaps there will be a disasterous OpenBSD vulnerability the day after I publish this. I’m not making a big statement that I will be doing things this way forever now.
Nevertheless, this migration has improved my confidence in my web hosting setup today. The configs are easy to understand and all feel very similar to each other. The simplicity of the httpd feature-set helped me discover a few things I should have been doing but wasn’t, like a proper 404 page. I enjoyed reading the Michael Lucas book about httpd on the subway (it’s slightly outdated but well worth your money).
And it’s really nice to start ignoring Linux patch news.