Live data from Hacker News

Self-Hosting Dozens of Web Applications and Services on a Single Server

cprimozic.net

121–130 of 285 posts

Re: Self-Hosting Dozens of Web Applications and Services on a Single Server

#121
post #66

Three independent, but somewhat related thoughts on this topic: 1). On HOWTO articles about infra (1/2): I'd like to see more articles that lead with requirements, rather than setups that then justify the setup with requirements. Like, congrats, you managed to host a bunch of web applications via containers on a dedicated server. It's really nice for a super personal project and I'm sure it helped OP gain a lot of op…

> I just find this type of article to be "DYI porn" for a highly specific subset of DYI.

This seems unnecessarily dismissive. (But maybe that means I am part of the 'specific subset'... :) ). IMO there is a big difference between 'tinkering' and 'self-hosting'. Projects you are tinkering with are typically transitory and can be treated as "pets". But in the 'self-hosted' world, stability and ease of maintenance are huge. In that regard I think the overhead of containers makes total sense, especially when running a bunch of stuff on the same server.

Re: Self-Hosting Dozens of Web Applications and Services on a Single Server

#122
post #66

Three independent, but somewhat related thoughts on this topic: 1). On HOWTO articles about infra (1/2): I'd like to see more articles that lead with requirements, rather than setups that then justify the setup with requirements. Like, congrats, you managed to host a bunch of web applications via containers on a dedicated server. It's really nice for a super personal project and I'm sure it helped OP gain a lot of op…

Heroku is "AWS on Rails" taken to an extreme and there have been lots of other in-between services and tools. Cloud 66, Laravel Forge and even AWS's Elastic Beanstalk are all part of that spectrum.

Re: Self-Hosting Dozens of Web Applications and Services on a Single Server

#123
post #68

Be careful with docker and ufw though! Any rules you setup in ufw will be ignored by docker, so exposing a container will always open it up to the public even if you specifically denied access through ufw.

Technically, Docker is adding iptables rules that are ignored by ufw rather than docker ignoring ufw.

To fix, just turn off iptables for the docker daemon and add the rules manually to UFW

Re: Self-Hosting Dozens of Web Applications and Services on a Single Server

#124
I’m using the same server type from OVH in Hillsboro and it’s great. They frequently do sales. Highly recommend anyone interested to go for the nvme upgrade.

I rent three now total, one for production sites, one as a development machine strictly for vscode and another for development / staging / misc. waaaaaay overkill but it’s been a huge quality of life improvement.

For containers I just use a couple docker compose and a script to run them all.

Reverse proxy is through nginx proxy manager which takes care of LE renewals and has a nice web interface.

Re: Self-Hosting Dozens of Web Applications and Services on a Single Server

#125
post #2

I went the opposite direction, 1 vm per service. It's much easier to secure, backup, restore thanks to full isolation.

But that bloats your backups like crazy. Much better to use something like Ansible to setup the VMs and then just backup the data.

Re: Self-Hosting Dozens of Web Applications and Services on a Single Server

#126
post #66

Three independent, but somewhat related thoughts on this topic: 1). On HOWTO articles about infra (1/2): I'd like to see more articles that lead with requirements, rather than setups that then justify the setup with requirements. Like, congrats, you managed to host a bunch of web applications via containers on a dedicated server. It's really nice for a super personal project and I'm sure it helped OP gain a lot of op…

> I just find this type of article to be "DYI porn" for a highly specific subset of DYI. This seems unnecessarily dismissive. (But maybe that means I am part of the 'specific subset'... :) ). IMO there is a big difference between 'tinkering' and 'self-hosting'. Projects you are tinkering with are typically transitory and can be treated as "pets". But in the 'self-hosted' world, stability and ease of maintenance are h…

I may also be part of that highly specific subset because I enjoy these kinds of articles as well. It’s interesting to explore different solutions and to und west and their pros and cons even if they aren’t motivated by upfront requirements (you’re probably less likely to come up with an interesting configuration in that case anyway).

Re: Self-Hosting Dozens of Web Applications and Services on a Single Server

#127
post #95
post #77

Earlier quoted context omitted.

There is a life beyond AWS. I host applications (including ones responsible for 10s of millions in revenue) on dedicated servers rented from Hetzner and OVH. Do not even do containers as my normal deployment is server per particular business (with standby) and the cost of renting a dedicated server comparatively to revenue is microscopic. CI/CD / setup from scratch / backup / restore is handled by a single bash scrip…

What do you use for backup?

I would recommend to use borgbackup - it is very convenient for security (it provides very flexible encryption options with safe defaults) and efficiency (deduplication)

Re: Self-Hosting Dozens of Web Applications and Services on a Single Server

#128
post #68

Be careful with docker and ufw though! Any rules you setup in ufw will be ignored by docker, so exposing a container will always open it up to the public even if you specifically denied access through ufw.

Technically, Docker is adding iptables rules that are ignored by ufw rather than docker ignoring ufw. To fix, just turn off iptables for the docker daemon and add the rules manually to UFW

And if you don’t want to do that because there are some downsides, make sure you setup container networking correctly and don’t just expose ports just to expose ports. Learned that one the hard way when someone exposed redis.

Re: Self-Hosting Dozens of Web Applications and Services on a Single Server

#129
post #77

Earlier quoted context omitted.

There is a life beyond AWS. I host applications (including ones responsible for 10s of millions in revenue) on dedicated servers rented from Hetzner and OVH. Do not even do containers as my normal deployment is server per particular business (with standby) and the cost of renting a dedicated server comparatively to revenue is microscopic. CI/CD / setup from scratch / backup / restore is handled by a single bash scrip…

The business benefits of the cloud are ability to scale, an API for everything, cheap automation, cheap managed services for everything, and good customer support. Like you say for your model none of those things may be important, but they're killer features for others

>"ability to scale"

I write C++ business API servers. On the type of hardware I rent from Hetzner /OVH they're capable of processing thousands of requests per second. This would cover probably 90+ percent of real world businesses.

>"an API for everything"

Not sure what you mean here. API for what in particular? My servers talk to partner systems of real businesses. We consume their APIs and they consume ours. Integration is done by little plugins that translate requests should it be needed. I am not sure how Amazon will help in this department. The only generic API that everyone uses is email but you do not need Amazon for that. As for database - I always deploy one local to my business server.

>"good customer support"

Frankly in many years there was like 2-3 times when I needed something resembling support from Hetzner / OVH. In either case the response was prompt and satisfactory.

Re: Self-Hosting Dozens of Web Applications and Services on a Single Server

#130

I (my company) use a similar approach: a single dedicated server with docker containers, by using dokku [0], for an heroku-like self-hosted PaaS. Most of our applications are either: - app developped in-house (django/flask): Procfile + deploy with git push - standard app with a docker image available: deploy directly Dokku comes with useful "service" plugins for databases, auto https (letsencrypt), virtual hosts... O…

Pardon my curiosity, but do you pay for Dokku Pro?

I do not.
Post reply on HN