I like to make tiny websites. My requirements for my sites are something like:
- I have maybe 20 websites (mostly static but not all)
- I want to spend basically 0 time maintaining them, maybe 5 minutes every 2 months at most
- I need to be able to ignore a project for 3 years and then come back and be able to develop it easily
here are some of the ways I choose tools to keep my sites running without doing a lot of maintenance. this is a draft, might clean it up and make it into a real post later
1. Make static websites
Most of my websites are static. There are a few subcategories of static websites:
- Genuinely just an HTML page, like css examples
- Sites generated by a static site generator, like this blog. I use [Hugo](https://g…
I like to make tiny websites. My requirements for my sites are something like:
- I have maybe 20 websites (mostly static but not all)
- I want to spend basically 0 time maintaining them, maybe 5 minutes every 2 months at most
- I need to be able to ignore a project for 3 years and then come back and be able to develop it easily
here are some of the ways I choose tools to keep my sites running without doing a lot of maintenance. this is a draft, might clean it up and make it into a real post later
1. Make static websites
Most of my websites are static. There are a few subcategories of static websites:
- Genuinely just an HTML page, like css examples
- Sites generated by a static site generator, like this blog. I use Hugo and it’s held up well for me for the last 10 years or so. I did try out 11ty recently for a nonprofit website I was working on and it was a really good experience.
- Single-page standalone Javascript sites which are just HTML, CSS, and JS, like this questions site or sql playground or integer.exposed
- Static sites which use OAuth to let the user login to an external API, like mastodon thread view, or a FitBit app I wrote one time that no longer works because Google stopped setting
Access-Control-Allow-Origin: *on the FitBit API
2. Use a "serverless" function
If the best thing is a static website, to me the second-best thing is a website which is hosted in a "serverless" function. That’s because all of my sites with servers sometimes give me problems: even with my best attempts at monitoring and restarts, occasionally I need to intervene and restart something manually.
I only have two sites like this right now:
- DNS lookup site
- A personal site for managing my doorbell
I like this style when it works, but most of the time by the time I get to the point of needing a server I want to do something that’s too complicated for this kind of thing.
I’ve used Netlify Functions for this but I know you can use AWS Lambda too, I saw a great talk from Katherine Berry about using Lambda.
3. A server written in Go
Next, if I’m going to write a server, I like to write tiny API servers in Go, because Go is so easy to deploy. Some things I like about Go:
- The application is just a static binary: which means that if I want I can just
scpthe binary to the server where I want to run it - It’s efficient, which means that I can probably get away with running it on a cheap VM with only 256MB of RAM.
If I’m writing a Go API server, I’ll usually do all of my HTML templating on the frontend in Vue.js.
This is probably the way of making dynamic sites I’m most comfortable with right now. Some sites that work like this:
- Mess with DNS
- nginx playground
- memory-spy
- at least 3 more personal projects
4. Keep my server deployments mostly declarative
There are two ways I run dynamic websites:
- Use some kind of Heroku-like platform. I run 3 services this way right now.
- Use Nix on a VPS. I am two years into using NixOS to run servers and I’m still relatively happy with it. Right now it’s running 7 tiny servers and I like being 100% sure that all the info about how to configure those services is in a Git repository.
5. Don’t use a Javascript build system
I want my projects to be easy to come back to, so usually I do not use a build system on my frontend projects.
I wrote a lot more about this in Writing Javascript without a build system and Importing a frontend Javascript library without a build system
I like to vendor my Javascript dependencies.
every programming language I use
Almost all of my sites are either static sites or have a Go backend.
I’ve been experimenting with other approaches though: right now I’m writing a site in Django, and I have one very tiny site in node.js (it’s just 1 JS file with no dependencies).
saving money on hosting
My main strategies for keeping hosting costs down are:
- free static site hosting: github pages (and I believe netlify) can host static sites for free, as long as you’re below their bandwidth limit
- Try to avoid buying domains. Mostly I create new subdomains under jvns.ca or wizardzines.com. Subdomains are free!
- I have a $5/month VPS which runs maybe 6 sites. Personally I don’t like to run "real" projects on that VPS though. None of the sites I’ve mentioned on this blog run on that VPS.
I do like to use "some kind of Heroku-like platform" for my dynamic sites which is at odds with "keep costs minimal", because each site like that costs at least $3/month or so. So if I’m going to run something on a Heroku-like platform I make sure it’s worth $5/month to me to keep it online.
some thoughts on hosting services
I don’t like to talk too much about which hosting services I use on this blog, I’ve been through the cycle of use hosting service -> get excited about how great it is -> be disappointed too many times to want to promote anything in particular.
Generally I like more "managed"-style services (like heroku, fly.io, glitch, github pages, etc) instead of running my own VPS because it means less work for me. If I end up being unhappy with the service I can always switch to something else. Once I moved all of my static sites to a VPS sort of to prove to myself that I could, but I ended up moving them back.
I will say that (in alphabetical order) I’ve used Cloudflare, Digital Ocean, fly.io, Glitch, GitHub Pages, Heroku, Hetzner, nearlyfreespeech.net, Netlify and val.town. Some of them I’ve stopped using for various reasons and some I’m still using.
I’ve also used GitHub Actions, Honeycomb, https://healthchecks.io/, S3, and probably more things I’m forgetting.
(obviously please do not post this to hacker news)