← sources

Self-hosting my studio's website on a Mac mini, where every page is a single Postgres query

source: reddit (reddit:selfhosted)published 2026-10-31 15:52ingested 2026-11-01 02:38

retained text

Wanted to share the setup since it’s a little unusual. [studionull.io](http://studionull.io) is a small design studio site, but the site itself is the experiment: every page is one SQL query, and Postgres returns the finished HTML. Node and Express only route the request. There’s a \[ sql \] button on every page that shows the query that drew it.

Hosting: PostgreSQL 16 and Node on a Mac mini at home in Denver, PM2 for process management, cloudflared as a launch daemon for the tunnel, so nothing is port-forwarded. A nightly launchd job commits and pushes the repo as backup. The homepage query takes about 8 ms; the slow part under load turned out to be the home uplink sending 300 KB of uncompressed HTML to Cloudflare, which compression at the origin fixed.

The part people seem to like: a few ESP8266 boards around the house are tied into it. One listens to the washing machine and sends a push when it goes quiet. One watches a closet light. And there’s a \[ knock \] button on the homepage that switches on a real lamp next to the server and reports back how long the round trip took. There’s also a TRMNL e-ink screen on my desk that shows notes people leave through the QR code on my business cards, rendered by Playwright on the same machine.

Happy to answer anything about the tunnel, PM2 on macOS (launchd and PM2 startup were the fiddly part), or keeping Postgres alive across reboots.

[https://studionull.io](https://studionull.io)

document fetched 2026-11-01 00:28 · canonical https://reddit.com/r/selfhosted/comments/1xkdp6s/selfhosting_my_studios_website_on_a_mac_mini