DEV Community

loading...

Where should I host my static website?

dannysteenman profile image Danny Steenman Updated on ・1 min read

I got a tech blog which I build using GatsbyJS. I care about performance, extendibility, caching flexibility and easy onboarding. I found that there are lots of options to choose from:

  • Now by Zeit.co
  • Firebase Hosting
  • Netlify
  • Surge
  • GitHub Pages
  • Amazon S3 + CloudFront
  • AWS Amplify

Which service did you guys use to deploy your static site and tell me how you made your decision.

Edit: I’ve decided to go with netlify for now because of it’s simplicity. Once I hit a bandwidth limit, I might think of deploying it to AWS amplify.

Discussion (41)

pic
Editor guide
Collapse
phlash909 profile image
Phil Ashby

Mine's built with Hugo locally, then pushed to Azure Storage and fronted with Azure CDN. I already have a VM in Azure and host dynamic content on it, so it was a route of lowest pain to click some buttons and add a few cents to the bill while getting global caching, free SSL certs, and some CPU cycles back on the VM to host Jisti for the family :)

I was able to include a custom header rule in the CDN to keep my X-Clacks-Overhead running too.

Collapse
silvether profile image
silvether

+1 for HUGO

Collapse
lazerfx profile image
Peter Street

+1 for an X-Clacks-Overhead...

Collapse
patarapolw profile image
Pacharapol Withayasakpunt • Edited

Now.sh does too much for me, and always try to build on their server, so it is out.

GitHub Pages is slow to update, and has rate limits.

I don't like Surge.

So, what is left for me is Netlify, Firebase Hosting and Amazon's, but I haven't tried Amazon much. Also, Netlify has good community, so I go with Netlify.

Haven't touch Netlify CMS, though; although I have tried to manage one myself. You might eventually need a CMS.

About CMS, I think Hasura is probably good.

Collapse
dannysteenman profile image
Danny Steenman Author

I'm using Contentful CMS and it works pretty well cause you can integrate it in the form of webhooks to trigger deploys in Netlify for example.

Collapse
andre347 profile image
Andre de Vries

For personal projects I choose Now by Zeit.co/Vercel. Great support and easy to get setup. For proper deployments I use Amplify. It has the full AWS ecosystem and you get access to lots more services and it's easy to implement authentication.

Collapse
codemouse92 profile image
Jason C. McDonald • Edited

Linode here! Inexpensive, high quality service, haven't had a problem with them once in all the years I've been using them. They not only host multiple static sites for me, but also my mail servers. There are plenty of pre-defined images you can spin up, or else just start with a blank LAMP and do things yourself. (By the way, consider using my referral code if you sign up with them.)

As to domain name, I recommend Gandi.net. They're the oldest, most reliable, and most secure registrar out there, and their prices are at least as good as any other ICANN registrar.

Collapse
lietux profile image
Janne "Lietu" Enberg

Two options I really recommend nowadays:

  • GitHub Pages: Free, Let's Encrypt enabled, hassle free, just works.
  • Google Cloud Run: Really cost-efficient, extensible later with backends, etc., Let's Encrypt enabled

With Google Cloud Run you have to set up a build pipeline to build a Docker image and push it to the Container Registry and release to Cloud Run automatically, but this is not a lot of work, and you can use Travis-CI, Google Cloud Build (120min/day for free, afterwards really affordable), etc. to take care of it automatically.

Cloud Run isn't "serverless", but nothing really is, there's just varying degrees of what control you have over the servers in question. In case of Cloud Run it uses Dockerized containers and Google takes care of automatic scaling, load balancing, fault recovery etc. completely. For most use it's going to be incredibly cheap, as long as you're not hosting like big video assets and such there and have significant traffic.

Collapse
lietux profile image
Janne "Lietu" Enberg

Oh and in case of GitHub Pages I typically still use some tool like Hugo, Gatsby, or something and Travis-CI to build and release the results to GH Pages.

Collapse
dannysteenman profile image
Danny Steenman Author

GH Pages sounds like a doable option! I'm wondering; do you deploy the "public" build folder in a separate repo or keep it in the same repo?

Thread Thread
lietux profile image
Janne "Lietu" Enberg

Sometimes separate, mostly the same and just use gh-pages branch, depends a bit on what I want from the end result - if you don't use custom domains GitHub Pages hosting can lead to very funky URLs sometimes unless you deploy to specially named repos.

Collapse
rizary profile image
Andika Demas Riyandi

Can we use CDN for the app running in the cloud run?

Collapse
esaesa profile image
Islam Sameh

Can you elaborate more about google Run and CDN costs

Collapse
mrrcollins profile image
Ryan Collins

My static website is built with Pelican and published on Github pages behind Cloudflare. Basically, free, simple and easy.

I've put it up on Apache and S3 before, but I figured, why not put it all on Github and then I don't have to worry about it.

Collapse
dannysteenman profile image
Danny Steenman Author

You als configured cloudflare to handle the caching? I think that github pages deploys to Cloudfront?

Collapse
mrrcollins profile image
Ryan Collins

You have to use a custom domain, but yes. Cloudflare gives me SSL and caching. I haven't seen any slowness, and updates show up in seconds.

One hundred score on Page Insights. 😁

Collapse
sepyrt profile image
Dimitris R

I've tried both Netlify and Surge to host a simple static page. I ended up with Surge because it was easier to setup https without having to move DNS servers.

Collapse
dannysteenman profile image
Danny Steenman Author

Never heard of Surge but it looks quite ok 👌! What about the caching performance of Surge?

Collapse
sepyrt profile image
Dimitris R

I am using Cloudflare to manage DNS so it takes care of the caching as well :) And since they provide you with SSL out of the box, in order to use https on your Surge site all you have to do is include a CNAME file containing https://www.your-site.com

Thread Thread
dannysteenman profile image
Danny Steenman Author

oh sweet! do you have a link to your site?

Thread Thread
sepyrt profile image
Dimitris R

Its meeloform.com, but nothing to see yet :)

I started a small project last week and was looking for the easiest/fastest way I could have a static site hosted somewhere. It will be a simple LP for the app that i'm building.

Collapse
bobbyiliev profile image
Bobby Iliev

I host all of my sites with DigitalOcean. I love the flexibility and clear pricing. You could host multiple static sites on 1 server and add CloudFlare for free as a CDN.

If I had to choose from the list, I would go for GitHub Pages.

Collapse
waylonwalker profile image
Waylon Walker

Build with GitHub actions to avoid build cost. I'm nonwhere near their bandwidth limit. But would blow through build minutes without building outside netlity. Just push to some sort of build/prod/gh_pages branch then point netlify to that branch with no build command.

Collapse
nikoheikkila profile image
Niko Heikkilä

I've liked Now by ZEIT Vercel, but they constantly throttle my builds on their Hobby plan due to Dependabot sending a huge amount of pull requests to my Gatsby repository.

I've been looking into migrating to Netlify since they have interesting build plugins and lately began supporting incremental builds with Gatsby sites. You can also skip builds by matching a Git commit pattern which saves those precious build minutes.

Collapse
tonymet profile image
Tony Metzidis

firebase works well. + use cloud shell for remote editing & cloud build for CI

Collapse
tovare profile image
tovare • Edited

I use Cloudflare directly using workers, and it costs $5 a month for unlimited sites.

developers.cloudflare.com/workers/...

My monitoring on a very low-traffic site where a cache hit is not that likely suggest a reasonable global response rate of 160 ms in Europe, 210 ms in America, and 270 ms in the Asia-Pacific region (Measured using AgentSlug.com). The global reach is high and the cost low compared to having a single VM in Europe. However, the local latency is more elevated than local traffic to a local datacenter.

There are two small drawbacks:

  1. I would have liked more straightforward controls over headers, and their default script is very "functional," so I find it harder to read and modify than it should be.

  2. Cloudflare's policy is a bit ambiguous on other content types than HTML. Although their intent is clear to use their cache for web-pages and not a file or video-server, their language should be more precise. I do proxy Google cloud functions that produce JSON and such through Cloudflare to get the same origin on everything, and it would be better to be explicitly allowed to do so :-)

Collapse
jonrandy profile image
Jon Randy

I've been playing with fast.io - seems good

Collapse
dannysteenman profile image
Danny Steenman Author

So many services to choose from 😱. Getting stress from picking one. What attracts you to fast.io?

Collapse
jonrandy profile image
Jon Randy

Mainly the fact that deployment can be literally as easy as copying files from one folder to another on my local machine. Also incredibly fast to get up and running

Collapse
lucasqueiroz profile image
Lucas Queiroz

I currently use Netlify for my personal portfolio page. I had it hosted on Zeit (now called Vercel), but changed it when I discovered Vercel's CEO is apparently against the lockdown, which is sad.

Collapse
brycewray profile image
Bryce Wray

Could you give a link to that comment about the lockdown? Haven’t been able to find it through searching.

Collapse
kewbish profile image
Emilie Ma

For web apps, I've used Netlify, but for my personal site I just use GitHub Pages. Understandably, it takes some time to refresh, but that's fine with me.

Collapse
arvindamirtaa profile image
Arvind Nedumaran

Netlify has the simplest build+deploy workflow I have ever seen! Definitely doesn't get easier than that.

Collapse
dannysteenman profile image
Danny Steenman Author

Yes netlify definitely has the easiest setup.

Collapse
ronakjethwa profile image
Ronak Jethwa • Edited

I am a big fan of Netlify and the team running the platform up there. Use Netlify if your static site has a complex build.

Collapse
bayuangora profile image
Bayu Angora

I can host static site on Netlify via mobile easily. How to host static site on Surge via mobile?

Collapse
dannysteenman profile image
Danny Steenman Author

I checked their website and it seems you can easily deploy through your CLI. So this something that can be automated with github actions.

Collapse
dse profile image
d.s.e

As I had already a running a root server for years, the decision where to host was easy. The site is generated with Nikola and synced with a simple rsync command configured for nikola deploy.

Collapse
fayaz profile image
Fayaz Ahmed

Zeit because of SSR support to Nuxt(and Next)

Collapse
milon profile image
Nuruzzaman Milon

For my personal site, I use github pages. My site doesn't have a huge crowd, so I am not concerned about rate limiting. For my recipes site, I use netlify.

Collapse
wlun001 profile image
Wei Lun

Usually I will for Firebase for global CDN, fast and low cost, and I setup CI/CD for ease of deployment. So far the cost still at $0.