probably should be a ask hn, but in 2019 isn't there a ready to go docker image or something that allows you to be your own webhost. Isn't it weird that we still pay for someone to run an apache instance for us on the web?
1) You need an ISP which allows this (opening ports 80 and 443), or that allows hosting more generally.
2) It is probably not a good idea to have people manage webservers without in-depth security and server knowledge.
3) You still have to arrange DNS-hosting.
4) Webhosting can be a lot of things, e.g. database hosting, http website hosting, email hosting, etc...
5) When hosting your own website, traffic bursts might become a problem for your own internet. Do you really want to open your own IP for DDoS attacks?
6) Probably external nameservers (e.g. cloudflare) would be a good idea (see 5).
7) By hosting your own server, you have a lot more legal liabilities.
There's a lot more to this than you would think on first sight. I outlined just a few problems and issues above, but there's probably many more. Truth is that it's probably not a good idea to host your own website if you're just a small business, or hobbyist (unless you want to learn something).
> You need an ISP which allows this (opening ports 80 and 443)
Anywhere on the internet that allows you to run a box allows you pretty much any port you like. DO, Linode, Light Sail
> It is probably not a good idea to have people manage webservers without in-depth security and server knowledge.
Yes. But in my experiences most pwning happens due to application sec rather than server sec. i.e wordpress/drupal instances that aren't updated regularly and vulnerable plugins installed on the same. But I see your point, and I think it applies to any DIY effort.
Yeah, when you sign up to any host out there they give email, seo, and logging. But I feel most clients would only really need database + app + email services. And for email Gmail and Proton are really the only quality choices. So you could get away with only offering database + app hosting.
> You still have to arrange DNS-hosting.
no, I think most domain registras will do this for you and offer a decent interface around this. I use namecheap and they are just stellar!
> When hosting your own website, traffic bursts might become a problem
This is the same for most webhosts anyway. In fact the problem is worse for webhosts. The cheapest box on Digital Ocean can easily outperform you run of the mill webhosting package. The resources available to each app on shared hosting is laughable for anything but you mom and pops local bakery or blog.
> Do you really want to open your own IP for DDoS attacks?
I don't think this is a problem you can get away from either way. You eventually have to use a service like cloudflare as you mentioned for this; webhosted or DIY.
> By hosting your own server, you have a lot more legal liabilities.
I agree with you on this one.
> Anywhere on the internet that allows you to run a box allows you pretty much any port you like. DO, Linode, Light Sail
So instead of paying someone to run Apache for you, you pay someone to run the box you run your Apache on? Why is that better if you just need Apache running somewhere? I run my own stuff on a VPS too, but for people just wanting hosting I'd generally recommend plain hosting from a trustworthy provider.
I'm pretty font of dokku. Runs great on DigitalOcean. I would DIY it on a base linux image so you have an easier upgrade path. The extension for Let's Encrypt is pretty great too. I tend to just have a Dockerfile in the root of my project, and `git push deploy` up to it when tests pass. It works well for single-server small/mid sized applications. You still have full docker for other bits, but the integration is nice.
NOTE: if you use the $5 droplet level, you must add a swap file or you will have issues. You probably should do this anyway.