Ask HN: What free or low-cost static site hosting do you use most?

209 points by shovel ↗ HN
I still use Wordpress and shared hosting for most projects and microsites, simply because it's easiest and I'm not a developer. But I suspect there are better ways to do this in 2016/2017. Especially since I'm prepared to learn more.

Essentials: static hosting, custom domains, html, css, js Nice to have: php, FTP, markdown support

Am I missing out on AWS, Github, Digital Ocean, Heroku?

What are the pros and cons?

228 comments

[ 1.1 ms ] story [ 303 ms ] thread
I use Google AppEngine with Python SDK. Whilst it is intended for web apps (and I use it for that too) it works well serving up static content alone. Very easy to add interactivity as and when the need arises. Also has access to Google Cloud services.

I like that I can check my changes on my notebook before uploading to the cloud.

For static sites I used to use surge [0], but now I use Neltify [1] for my site [2], because it offers free SSL on your own domain, and continuous deployment from a GitHub or Gitlab repository. You can set your own build options, for example to build Jekyll.

(I have no affiliation with Netlify I just think their service is neat.)

[0] https://surge.sh/

[1] https://www.netlify.com/

[2] https://gilly.tk

edit: formatting

netlify looks great, and the free tier covers probably 90% of what all SMEs need. I'm curious, where are the sites actually hosted?

Does netlify provide the actual hosting or they allow you to setup deployment to a VPS? Also if netlify does the hosting, how good is their uptime/availability?

+1 for Netlify. Have a dozen or so production sites there currently and am a happy customer.
I work for Netlify.

We host the sites on our CDN, which has more than a dozen points of presence around the world. You can either let us build your site using anything you can get working on linux (see https://www.netlify.com/blog/2016/10/18/how-our-build-bots-b... for details) or build it yourself and ship the finished product to us. Nothing "runs" on our side after build, so there are no servers/VPS's which you can configure in the equation as far as hosting is concerned. We let you do a few things that you used to do with htaccess files (redirects are free; custom headers including basic auth are a paid feature)

You can check out our list of past incidents on our status page to gauge uptime for yourself: http://netlifystatus.com/

Since we use redundant DNS (NS1 + self-hosted), and use dynamic DNS response based on both location the query comes from cross product which CDN nodes are responding, we can (and occasionally do) remove, rebuild, or add CDN nodes without affecting our overall service. Since we use multiple network providers (for instance we use AWS, but we also use 3 other services), downtime at any one of our providers won't introduce any substantial problems in our network.

I wanted to migrate to Netlify (I'm currently very happy with Gitlab pages), but I don't want to have to install all of node just to use their utility. What's wrong with static binaries, or at least Python?
I work for Netlify.

You don't have to use any of our clients to deploy a site; they're just options in case you'd rather build the site yourself than have us build it. I rarely use the clients (we have one in go in addition to the Node.js version: https://github.com/netlify/netlify-go and further our API is scriptable in any language and fully documented here: https://open-api.netlify.com/)

You can (and we do this for you by default) configure GitHub, GitLab, or Bitbucket to trigger a build whenever you do something at the repo. The default, free behavior builds on pushes or PR's against your selected branch and if it's a PR, shows you a deploy preview rather than publishing at your main URL: https://www.netlify.com/blog/2016/07/20/introducing-deploy-p...).

Finally you can drag and drop a zipfile with your site's built contents, if you are in a hurry or less technically inclined.

So, you don't need Node to use us and I don't think most of our customers do use that client; most build direct from their repositories.

Thank you, I'm one of those impossible customers who goes "oh I want a free tier, and oh, I don't like node, and oh, I don't want to give you access to my Gitlab", but it's great that you have a Go version of the client. I think I'm going to switch everything to you, I've been wanting to for a while!
awesome to hear! I'm the guy you'll talk to if you have a support question, so I hope to not hear from you soon (since that would mean that everything worked as expected :))
I'm sorry you had to hear from me, but I recant! Netlify is, indeed, fantastic. It took five minutes to move my site over, and fifteen minutes to waste Chris' time with questions.

I'm amazed at how fast the site is now: https://portfolio.stavros.io/

aws: s3/cloudfront.
Github Pages does pretty much everything you've listed. Also Github Pages explicity allows companies to setup and host their corporate websites on there.

PROS: It is free, always available, and the deploy is easy once you get the hang of git.

One big inconvenient is that they don't support HTTPS for custom domains
Which you can solve with cloudflare for free.
I generally use nearlyfreespeech.net

I added about 5 gbp two years ago and it's down to about 4 gbp. It's cheap as hell and I only have to dump 5 pounds on there every few years or so.

Of all services mentioned here, this is the one I like the most and the one I think I'll use.

Their pay as you go makes totally sense when you have a static website that will be access sporadically and you don't want to rely in a public infrastructure such as Github.

I also don't want to depend on freemium services, because they could just shut down the free tier any time.

I run a cheap OVH VPS for hosting. I can host any number of websites I want and it costs less than any static hosting service.

Also, Github Pages and Gitlab Pages are great and free. You can't beat free if it's reliable and both of those two are reliable.

www.nearlyfreespeech.net is cheap (really cheap, hence the name) and reliable - they've been around since 2002, and I've used them since 2008.
IIRC I think the name is because they allow a lot of content that other hosts may shy away from.
It's both: "For everyone to have free speech, they need to be able to afford it."
Look for deals on LowEndBox, there are some amazing ones.
For static sites I use firebase hosting, quite simple to use and it includes a free SSL certificate https://firebase.google.com/docs/hosting/
I'd appreciate if someone could jump in about the costs of a high traffic website firebase hosting, as I don't have much experience with other hosting platforms.
I think I'd go with DigitalOcean $5/mo, nginx, a static site generator (there's so many), and LetsEncrypt (for SSL).
I'm with you on this one. Given the choice between configuring nginx and navigating AWS/Wordpress' arcane configuration GUIs, I'll go with nginx every day.
I have a soft spot for Neocities, which is trying to be everything we loved about Geocities, but for a modern age:

https://neocities.org/

ZERO ADVERTISEMENTS, even for the free plan. Supports only static hosting, is free for 100mb websites with bandwidth of 50GB per month, or five dollars per month for 10,000mb with 2TB and a number of other extra features.

EDIT: As mentioned by detaro, custom domain only supported in the paid plan, see https://neocities.org/supporter

Works really well with creative coding frameworks like p5js or Twine, for fun, fast little sketches you just want to thrown online and share with others:

http://p5js.org/

http://twinery.org/

Also, they really care about resurrecting the ideals of the old internet:

https://blog.neocities.org/its-time-for-the-permanent-web.ht...

https://blog.neocities.org/default-ssl.html

I loved geocities too, and I always wished I"d had a CORS backend to call from my HTML pages. I built a service specifically to be a CORS backend for neocities. You can signup, and start making CORS calls from your neocities pages to a sqlite database on my service. I tried several times to contact the owner of neocities about this but he never responded. Since then I implemented static file hosting and pivoted to a "Single Page App One Stop Shop" model. We offer custom domains and free ssl (Lets Encrypt) for early adopters. Link in my profile.
> You can signup, and start making CORS calls from your neocities pages to a sqlite database on my service.

If I'm understanding what you're trying to do, this isn't on our end. Neocities currently doesn't prevent sites from making API calls to other servers - that's on your HTTP server's side, you control that.

Occasionally I get requests to allow HTML hosted on Neocities to make API calls directly to Neocities itself - which would be OK for things like basic stats lookup, but for things like file uploading/deleting/editing this is dangerous, because it would allow attackers to write scripts to hack people's accounts that can be executed by their own browsers. This is called a CSRF attack, and that's why we prevent people from doing that.

(comment deleted)
Neocities is slightly more expensive hosting (if I want to use my custom domain, which I do) than other options. $5/mo is still really affordable though and I like what they're doing so I chose to support them.
Thanks for the warm words!

> ZERO ADVERTISEMENTS, even for the free plan. Supports only static hosting, is free for 100mb websites with bandwidth of 50GB per month, or five dollars per month for 10,000mb with 2TB and a number of other extra features

Haven't announced yet, but these numbers are all increasing soon. Well, except for the advertising one. I'm literally in the datacenter right now working on it.

You're welcome! I'm a happy supporter and have used it in the classroom as a no-fuss just-get-started option a few times.

(BTW, the list on https://blog.neocities.org/ seems outdated - it doesn't mention that SSL article for example)

> Well, except for the advertising one.

What about the five dollars per month one?

Be nice if neocities support Lektor (https://www.getlektor.com/), or some sort of web gui static publishing framework. Something easy like WordPress, but not so blog focused. I'd do it myself if I had macOS, but haven't got it setup for Windows yet.
I use AWS S3, which I put behind a Cloudfront distribution. It's quick to set up, and there are no servers to keep up to date and patched. You also get free SSL for your Cloudfront distribution via AWS certificate manager. For stuff like Contact Us forms, I use AWS Lambda to post the data into my company's CMS. We've had this setup for about a year now and it works quite well.

The cost is almost nothing but we don't have a high traffic website. If you started getting billions of hits from expensive Cloudfront regions such as Australia or India, you might consider something else.

A quick note on the S3/Cloudfront option - make sure you enable "Compress Objects Automatically"; it's not enabled by default and wasn't provided for a long time.

https://aws.amazon.com/blogs/aws/new-gzip-compression-suppor...

You'll save a lot on your bandwidth bill.

You can also set your edge usage to "Use Only US, Canada, and Europe" vs. "Use All Edge Locations" to save money, depending on your performance needs in various geographies.
This is probably a better option than storing compressed data in S3 with a hard-coded Content-Encoding header, as it seems some web clients (like the Facebook app) display the raw gzip data.
(comment deleted)
It's worth noting that SSL only works between the browser and Cloudfront servers. Last time I checked there wasn't an option to use SSL with s3.

It's not a deal breaker, but it was enough to make me look for alternatives.

If I understand what you're saying, if the origin for your Cloudfront distribution is an S3 bucket, the link between S3 and Cloudfront is unencrypted? That seems unimaginable to me.
If the origin is an S3 static website, the link is unencrypted but should run over Amazon's own network. Since Amazon has your S3 and CloudFront data anyway, assuming all CF endpoints are under Amazon's control, you don't lose much by having the S3 origin load over http.
That's just naive with the information we have today. Google thought this too, and the NSA happily used that to eavesdrop.
Eavesdropping on the connection between CF and S3 doesn't say too much about a public static website, though. If you're serving private data, use an S3 bucket directly instead of the S3 static website hosting HTTP server.
What makes you think that when cloudfront requests objects internally from s3, it's using http?

It could just as easily be connecting with s2n and authenticating both endpoints of the connection.

It says so in the CloudFront distribution setup, when you point it at an s3-website-[region] URL instead of directly at an S3 bucket.
This article[1] states the following, though it doesn't cite any specific source:

> CloudFront will use encryption when retrieving data from its storage service S3 (Simple Storage Service), so the content is protected all the way from where it is stored to the user's computer, according to Amazon.

1. http://www.computerworld.com/article/2518747/data-center/use...

Yup. It's fine for most simple sites that don't receive much traffic due to almost nonexistent costs. But I personally don't recommend it when there are many alternatives out there these days. Partly SSL is no SSL imo.
You can use SSL with S3 as the backend, you just have to set the distribution origin to s3.amazonaws.com/bucket-name/
Does that work with s3 static websites though? I recall that a different endpoint was needed, and it's only http.
The method I described doesn't require you to use a S3 static website. We don't have that option enabled, so the bucket name isn't mysite.com, it's "mysite-html", and the S3 website hosting is not enabled.

CloudFront has its own IAM user that is permitted to access the contents of the bucket, which means that it has to use the API. I don't think it's even possible to access the S3 API without using HTTPS. Therefore I think it is highly unlikely that the connection is unencrypted.

Awesome! I'm new to AWS, and when I tried to setup a static website using cloudfront + s3, I was only aware of the static website option on s3. This is what the docs uses, and it led me to the wrong path it seems! Thanks
GitHub Pages or Firebase.
How about github.io. Github pages allows us to host our custom domains too
as a few people have mentioned, NearlyFreeSpeech.net is my static host of choice. i use them for static blogs (jekyll built) and they work perfectly. non static sites get charged at 1c per day (and you get a MySQL instance for about 1c a day, give or take), and static has no charge per day. you are billed for bandwidth and storage, and can have multiple sites in one account. SSH/SFTP access available also.
dreamhost.

I manage all my sites there. Never had any issues with them, there is SSH access too so I recently set up a Hugo bitbucket pipeline which builds my personal website and rysncs it to dreamhost.

They were very fast to add lets encrypt support, so all that stuff is taken care automagically. Reliability is very good.

Github Pages + cloudflare + travis

why: free, cdn, version-controlled, continuous integration, https, custom domains.

+1 for Github Pages + Cloudflare

Wish there was a poll option on HN. How are you going to count OP? Will you share the results?

middleman -> s3 -> cloudfront. About $0.15/mo.

Pros: Generally works well, speedy enough, free ssl with Cloudfront, cheap for many sites (most hosts charge per site which catches me out for little projects). I've mostly got the process figured out now...

Cons: not easy or quick to set up, lots of steps to get right, AWS is a terrible UI, Cloudfront invalidations are apparently sent by carrier pigeon so asset hashing is a must, even then it can take a while to see your site updates

I've noticed a high mortality rate among static hosting sites, particularly those "just add files to Dropbox and we publish your site" services. Static hosting services are to ops people what todo list apps are to frontend designers

Also, to your point: you can't, by definition, run php on a static site.

> Cons: not easy or quick to set up, lots of steps to get right, AWS is a terrible UI, Cloudfront invalidations are apparently sent by carrier pigeon so asset hashing is a must, even then it can take a while to see your site updates

Check out the s3_website Docker container by attensee. We have it in our BitBucket pipeline, so that any push to the hosted repo will automatically copy the latest updates to our S3 bucket AND invalidate the respective assets quite quickly.

Any website refresh our developer in the US does now is usually available to look at within a minute here in Australia.

I'm very happy with the service at https://www.scaleway.com
Their pricing looks insane? Like an order of magnitude less than DO, OVH, ...

Edit: Looks like it's because they're using Atom and ARM based servers.

I host my static stuff (with my own domains) at FastMail, it's included in my "standard" plan. Upload is possible via FTP and DAV, the quota is currently 5GB disk space, 2GB or 80K files daily traffic.
I knew I had some free space with my Fastmail account but didn't realise how much - or that I could use my own domains. That's pretty cool.
Another vote for AWS S3 + CloudFront here.

We also have a distributed team updating and looking after our website, and we use BitBucket as our git repo. Recently implemented their Pipelines feature to auto update the S3 bucket and refresh CloudFront resources with any changes pushed to the repo.

Makes it really easy now - just a 'git push' and Bam!, the website is updated and CloudFront auto invalidates all the old assets and starts serving up the new stuff. Really smooth.

I use Nginx either on my basement server (I have 50/50 fiber internet at home) or I use one of my digital ocean droplets, which can be as cheap as 5$ a month, that is less than my server at home uses in power. A Raspberry pi would also suffice if there is not too much traffic I guess, that would cost you about 10€ a year in power. Running a whole server means there is no limit to the amount of sites you can run (apart from memory and bandwidth of course.)

Both my servers (DO vps and basement) run Ubuntu 16.04, I use PHP-fpm for PHP, domains I purchase at a local registrar (.nl domains are about 10€/year), for ssl I use lets encrypt. For simple sites I always use Bootstrap for the css.

FTP is implicit if you count SFTP as FTP (FTP over SSH). Under Linux SFTP is mounted as easily as any network share.

At home I run a Nextcloud instance and share some directories as Nginx roots, that means I can locally (even on my phone) edit a static web page and it is synced immediately to the webserver's root folder. This can be quite convenient.