root@labs:~$ cat building-the-new-rootlabs-us-the-stack.md

Building the new rootlabs.us: the stack

When we decided to rebuild rootlabs.us, we had one hard constraint and one soft one. The hard constraint: the whole thing runs on a small AWS Lightsail instance with a comically modest amount of memory. The soft constraint: we wanted to actually understand every piece of our own stack.

Here is what we landed on.

The server

A single Lightsail box running Ubuntu. A modest slice of CPU and disk, and memory best described as cozy. The first thing we did after logging in was add a swapfile, because MariaDB and PHP were about to fight over scraps.

Caddy instead of Apache

The old site ran Apache with .htaccess rewrites. The new one runs Caddy, and honestly, the config file is small enough to read out loud. Automatic HTTPS with Let’s Encrypt is built in, so certificates are just not a thing we think about anymore. Clean URLs, the WordPress permalink fallback, and a couple of redirects take about thirty lines total.

PHP, hold the framework

The main site is hand-written PHP with plain CSS and vanilla JavaScript. No build step, no node_modules folder, no framework migrations in our future. Every page is a file you can open and read. For a two person lab, the fanciest tool is rarely the right tool.

WordPress for the blog, but on a leash

The blog you are reading is WordPress, because the editor is good and the plugin ecosystem occasionally earns its keep. But it wears a custom theme we built to match the rest of the site, down to the sidebar and the graph paper background. The forums run bbPress inside the same install, so one app serves both.

The numbers

With everything running, the server idles at about half its memory. Page loads are fast because there is almost nothing to load. The whole setup costs less per month than a fancy coffee.

Would this stack survive a traffic spike from the front page of the internet? Probably not gracefully. Will it survive the two of us and the twelve people who read homelab blogs? Comfortably. Right-sizing is a feature.

Leave a comment

Your email address will not be published. Required fields are marked *