Ask HN: Does a static site need anything more than a simple VM running a server?
I'm an amateur blogger and programmer, running a custom-made static site on a Linode VM with Caddy [1]. I don't use containers or CDNs or anything fancy; my site generator just spits HTML into a folder and I rsync it to the server.
Do I need anything more than this? Is there some modern technology that is demonstrably better than my workflow? I worry I've been left behind, but I also find containers and other modern obsessions to be overkill for my needs.
Thanks for any and all advice.
[1]: https://caddyserver.com/
53 comments
[ 3.8 ms ] story [ 122 ms ] threadhttps://jamstack.org/
for instance host with
https://www.netlify.com/
Basically you check your files into GitHub and chill, it is as easy as it gets.
At some date after that point you'll be seen as a retro computing hobbyist if you're willing to change your personal brand, and people will flock to your blog to learn just how you manage to pull it off...
I can see two downsides to using a VM. 1) You need to update it. 2) Your website goes down if your VM goes down. Do these matter? I’d say 1) is moderately important and 2) depends on your website.
Using Netlify fixes these issues (but introduces other potential problems). Does that make it “demonstrably better”? Depends. I’m not you, so I don’t know any pain points or annoyances you have or what you consider important. At the end of the day it doesn’t make a difference to the actual website.
That said, it is very quick to try. Why not spend an hour or so and see if it’s worth it for yourself?
- https://pages.cloudflare.com/
- https://vercel.com/
- https://www.netlify.com/
- https://www.digitalocean.com/community/tutorials/how-to-depl...
Should your needs grow past simple static sites they are hoping you will use their paid options. This isn't a "you are the product" situation.
Also, I don't use Git or Github.
It's more complicated because you need to know more random tech that I bet you don't want to learn. Which is fine, it's really not necessary.
By the way, you should learn git sometime. Or there's a couple other VCSes that are somewhat known, but git is both good and has good networking effects (everyone uses it).
I'd love to be able to make red-line decisions like this regardless, no matter what. For example, I absolutely hate MacOS and would love to say "hard no" to any job offer if they insist that I use MacOS, regardless of job fit or TC. But ultimately, I back down once they show me the money, and find myself using it anyway.
In this case I'd say that "simple" is a product of familiarity, manual steps, and future maintenance. "Get a VM" also means "install stuff on a VM", "secure a VM", "monitor load, memory, disk space on a VM" and "manage a VM into the future, upgrading the host OS and fixing whatever breaks". Is rsync easier than git? Maybe, but it doesn't have version control (which is nice to have). I think the git suggestions are based on the assumption that only a tiny number of people could do VM setup, webserver config, rsync etc but couldn't do git add, commit and push.
Personally, I use Cloudflare because it handles DNS, CDN and is basically hands-off after setup.
* No need to install and configure web server
* No need to setup firewall
* No need to main and patch above components every day
* No need to upgrade the OS every few months/years
I have not used mercurial in close to a decade, but from what I can remember you could push to a git server from the mercurial client.
If you want to maintain your Mercurial setup then consider S3 + Cloudfront.
Its easy, cheap and resilient. If you want you can then cloudflare the site or aws have an equivalent service.
It costs about 6 cents a month.
There are easier ways _depending on the context of what you already know_. There are better ways depending on what you're optimizing for. For you I bet this will be hard to beat. For me, I'd probably throw it in AWS S3, because that's what I know without having to think about it or do much work.
Containers and other such things are more for when you need different things, like a dynamic site or backend async processing, or not a site at all, and especially when you need some/all of that and are tired of sysadmining a VM.
I say this as a very experienced aws and s3 user who also has several static and dynamic sites on s3 buckets, VPS & ECS.
netlify for simple static sites is a simpler and faster workflow with https and forms as 0 config and free.
This is what I would do.
Keep the Markdown files on your local PC.
- Add/modify Markdown files.
- run a bash script to
- - rsync them all to your VPS
- - run Caddy on VPS
Done.
View on your favorite web browser.
Kinda like your very own CI/CO.
I serve my blog from Node.js on Heroku, even though it's mostly statically rendered, because that's my comfort zone. A CDN or even nginx would be more efficient, but I don't need it to be. I much prefer having the breezy and familiar workflow
If you are fine with your site being down for short periods of them then this approach is perfectly fine. Otherwise you'd need to set up multiple instances and some sort of load balancing between then.
Others have suggested hosted solutions for static sites (Netlify, Vercel, Github Pages, Cloudflare) and I think those would be a lot easier if you want a no fuss production solution.
As others have said, you can just drop it in S3.
The other alternative is Cloudflare pages. It’s cheaper than s3 with a generous free tier. I find it less hassle than uploading to s3. Git commit, git push, a few moments later it’s deployed on a global CDN.
Both options will be cheaper than running a VM and maintenance free.
maybe i'm missing something as i didn't see anyone else suggest it, but i would just use github pages, or even something like gdrive, dropbox, mega can host html i think.
I think of it in terms of marginal cost. What is the cost of spinning up another site in a CDN/jamstack workflow? Not too bad if it's also static. What about spinning up another service like a database? Or not even leaving the HTTP space, what about a non-static site? I like having the flexibility of say hacking together a RSS aggregator in a weekend and throwing it onto my VPS behind my already running reverse proxy.
(Oh and it's a "free" VPN if you are already paying for the VPS for another reason.)
Vendor lock-in is no where near as bad for static sites too, as the actual static build is the same just slightly different deploy commands for different platforms.
A commercial product might not exist in a few years, but you can't guarantee someone else will pay for your Caddy server VM, after you're gone too.