6 ms·
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/
- xupybd 4y agoI run static sites on Amazon S3 storage with cloudflair in front. It costs about 6 cents a month.
- digianarchist 4y agoConsider these simpler alternatives: - https://pages.cloudflare.com/ https://pages.cloudflare.com/ - https://vercel.com/ https://vercel.com/ - https://www.netlify.com/ https://www.netlify.com/ - https://www.digitalocean.com/community/tutorials/how-to-deploy-a-static-website-to-the-cloud-with-digitalocean-app-platform https://www.digitalocean.com/community/tutorials/how-to-depl...
- ngcc_hk 4y agoMiss the digital ocean 3 free site offer. May try that.
- digianarchist 4y agoAlso forgot https://render.com/docs/static-sites https://render.com/docs/static-sites
- Sateeshm 4y agoYeah. My experience with hosting a svelte site on render was just amazing. Highly recommend it
- jzer0cool 4y agoDoes pages.cloudlare also run apps or just static pages?
- wiennat 4y agojust static page. But you can use their worker service to run some server-side functions
- _8j50 4y agoAzure websites and githubpages are nice too. Why pay when you don't have to?
- swidi 4y agoFree services never truly are, and I don't want to build something on a foundation I don't pay for. Corporate generosity always runs out eventually.
- _8j50 4y agoIt is not generosity, they hook you in for free so when your needs grow you will stick with their platform and pay. Static sites are cheap to host that is why it is free. 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.
- swidi 4y agoHow are any of these simpler than "Get VM, install server, rsync files"? Why is the solution always "sign up for a proprietary service that might not exist next year and rig up a bunch of fragile webhooks"? Also, I don't use Git or Github.
- kadoban 4y agoIt's simpler from a certain point of view, namely one where you don't want to have to maintain the VM. 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).
- swidi 4y agoI prefer Mercurial, and as a hobbyist I can afford to stay with it. I know Git has GitHub and all the connectivity of that, but I just truly dislike Git.
- raffraffraff 4y agoAh, I didn't see that you use mercurial instead of git when I made my last comment. 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.
- kadoban 4y agoThat works, as long as you know one of them.
- raffraffraff 4y agoI agree about the fragile frameworks but not the rest. 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.
- coffeefirst 4y agoSure. Mind your caching and it’ll be crazy fast and handle more traffic than you’ll ever throw at it.
- nprateem 4y agoS3
- BFLpL0QNek 4y agoYou don’t need a VM for static sites. 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.
- formerkrogemp 4y agoI think you'll be fine unless you suddenly get DDOS or something. But then cloud flare would solve that.
- PaulHoule 4y agoThat VM is obsolete, the new way is https://jamstack.org/ https://jamstack.org/ for instance host with https://www.netlify.com/ https://www.netlify.com/ Basically you check your files into GitHub and chill, it is as easy as it gets.
- Nextgrid 4y agoI disagree. It's not "obsolete", it's just a different option with its own pros and cons.
- ratg13 4y agoPerhaps not obsolete, but there is no sense in paying for a VM for a static site when things like Cloudflare Pages will do this for free.
- PaulHoule 4y agoAlso if the "value" here is "run a static web site without a lot of pain" services like Cloudflare pages, Netlify, AWS amplify are 𝐦𝐮𝐜𝐡 less effort and hassle than a static server like nginx when you consider SSL certificates and all that.
- themodelplumber 4y agoLinode VM and Caddy isn't too left behind. It's likely to continue being well within "just fine" parameters for at least the next decade. 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...
- ratorx 4y agoThe best “I just want to serve HTML” workflow I’ve found is the Netlify/GitHub Pages workflow, as long as you consider version control useful. 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?
- js4ever 4y agoNetlify is down 5-10 min each day since the last few days ... at this point I switched back to my VPS for better reliability ...
- smackeyacky 4y agoAWS S3 bucket set to serve static pages, use the aws command line to sync it with your source folder. Its easy, cheap and resilient. If you want you can then cloudflare the site or aws have an equivalent service.
- aliswe 4y agoAzure has the same, for the record
- xupybd 4y agoThis is what I do. Two sites minimal traffic and it's something like 6 cents a month.
- rurban 4y agoGitHub Pages are 0 cents a month. With the best uptime and reachability stats of all static hosters
- raffraffraff 4y agoReally? Better than Cloudflare, for example? I thought that github.com have had a rotten track record recently, but I'll be honest, I have no idea which services are/aren't impacted.
- rurban 4y agoI couldn't find recent proper performance tests, only spam. This is an old one: https://savjee.be/2017/10/Static-website-hosting-who-is-fastest/ https://savjee.be/2017/10/Static-website-hosting-who-is-fast...
- srvmshr 4y agoI do mine with Google Cloud storage. I found it simpler for setting up than AWS. Have used both
- deleted 4y ago[deleted]
- kadoban 4y agoYou don't need more than that. 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.
- kristjansson 4y agoS3 is the right answer for anyone with even passing familiarity with AWS. Bit of a pain that HTTPS requires cloudfront, but otherwise the dead-simplest way of getting HTML to a browser.
- fellowniusmonk 4y agoAs an exercise a few months ago I tried deploying a static site to a freshly purchased domain on netlify, start to finish I found it took less time than any aws workflow and gave me free inbound forms. 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.
- egberts1 4y agoCaddy, you say? 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.
- swidi 4y agoThis is my exact method. Render Markdown into HTML, rsync up to the Caddy server.
- nunez 4y agoThe only thing I'd add is a CI/CD pipeline to make updating the VM easy. Maybe an Ansible playbook to better ensure the files get copied and that Caddy gets updated, if needed. All optional though.
- brundolf 4y agoYou need something better if what you've got isn't doing the job. Doesn't sound like that's the case, so, there you go 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
- hnarayanan 4y agoYou don’t need anything more than this.
- paxys 4y agoThe only concern is that you don't have any redundancy. What happens when you push an update? What if the service provider shuts down the VM to patch it? 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.
- 5350-uiop-1130 4y agoa vm running a server is not really "simple", at least not by my idea for static html. i would think a vm/server is only needed if you have specific hosting requirements. 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.
- zamubafoo 4y agoOne thing to take into account is the flexibility of already having a VM over the touted CDN/jamstack workflow. 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.)
- gitgud 4y agoYou're paying $5-10 per month to host static files on a linode VM, when you could host it for free on netlify, vercel, github pages... etc 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.
- landa 4y agoFirebase Hosting is really good for this kind of thing. You can even expand it later to add more dynamic content.