Blog ran on Ubuntu 16.04 for 10 years. I migrated it to FreeBSD
A hacker migrated his blog from a decade-old, unsupported Ubuntu 16.04 server to FreeBSD, meticulously documenting the process and benchmarking impressive performance gains. This deep dive into FreeBSD Jails and system configuration resonated with HNers, sparking conversations on the merits of self-hosting, OS longevity, and the ongoing Linux vs. BSD debate. It's a tale of both technical curiosity and the surprising resilience of antiquated systems.
The Lowdown
Bruno Croci embarked on a mission to modernize his blog's infrastructure, moving it from a Digital Ocean VPS that had been running an unpatched Ubuntu 16.04 LTS for ten years. His motivations were multi-faceted: addressing security concerns from an unsupported OS, reducing costs, and a desire to delve into the world of FreeBSD.
The migration involved significant changes and explorations:
- Hardware Upgrade & Cost Savings: Switched from a $13/month Digital Ocean VPS with 2GB RAM/1 vCPU to a Hetzner VPS costing less than €6/month, offering 4GB RAM/2 vCPU.
- "If It Ain't Broke": The old Ubuntu server, despite its age, maintained an astonishing 1491 days of uptime, showcasing surprising robustness for a simple static site setup.
- Why FreeBSD?: Primarily driven by curiosity and a positive prior experience, the author was drawn to FreeBSD's reputed stability, security features, ZFS filesystem, and especially its Jails containerization technology.
- The New Stack: Implemented FreeBSD Jails, managed by Bastille, to isolate services. A Caddy server ran in one Jail for TLS termination and reverse proxying, while individual static sites (generated by Hugo) resided in their own Nginx Jails.
- Detailed Setup: Covered the steps for installing FreeBSD on Hetzner, configuring the network with PF (Packet Filter), setting up Bastille, and creating the Caddy and individual site Jails.
- Benchmarking: Employed
wrkandheyto compare the old and new servers. After tuningkern.ipc.somaxconnon FreeBSD, the new setup showed a dramatic 3-11x improvement in requests per second and significantly lower latency compared to the old, unoptimized Ubuntu machine. - Key Takeaways: The author noted the old Ubuntu's unexpected durability, the relative ease of configuring FreeBSD, the extensive networking knowledge required, and the sheer enjoyment of learning a new operating system.
Ultimately, the author successfully migrated his blog, finding satisfaction in the learning journey, even if much of his blog's traffic now consists of AI crawlers.
The Gossip
Aging OS Anguish & Upgrade Anxiety
Many users commiserate over ancient, unsupported Ubuntu installations, sharing tales of heroic (or avoided) upgrades and the inherent risks of "if it ain't broke, don't fix it" philosophies. The discussion highlights both the surprising resilience of old systems and the dread of tackling necessary migrations, sometimes leading to distro-hopping due to perceived "shenanigans" or breaking changes in newer Linux versions.
FreeBSD's Fantastic Foray
The author's move to FreeBSD sparks debate on its merits. Proponents laud its stability, security, and innovative features like Jails (often compared favorably to Docker due to sharing the same kernel but offering subsystem-like isolation), seeing it as a "punk rock" alternative. Critics, however, cite practical hurdles with tooling integration (e.g., PM2), logging, and firewall configuration (e.g., PF vs. UFW templates) compared to more common Linux environments, acknowledging Docker's prevalent ecosystem.
Self-Hosting vs. Serverless Squabble
A heated exchange unfolds on the "wisdom" of self-hosting a static blog on a VPS versus leveraging free, managed services like GitHub Pages or Cloudflare. Arguments range from the perceived financial and maintenance overhead of a VPS to the joy of full control, learning opportunities, and resilience against hypothetical "viral" traffic. Defenders of VPS hosting emphasize personal preference, the low cost, and the ability to customize the stack, while proponents of managed services highlight zero-maintenance, higher uptime, and built-in scalability.
Distro Durability & Debian Debates
The conversation veers into which Linux distributions offer the best long-term support and upgrade experience. Users discuss the pros and cons of CentOS alternatives (Alma/Rocky), Debian's stable releases, and even NixOS for its declarative configuration and trivial rollback capabilities. The debate balances the desire for minimal changes and security fixes with the challenges of managing ecosystem drift and the effort required for distribution upgrades.