Live data from Hacker News

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

cprimozic.net

101–110 of 285 posts

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

#101
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…

> It's really nice for a super personal project and I'm sure it helped OP gain a lot of operational experience across several domains, but I just find this type of article to be "DYI porn" for a highly specific subset of DYI.

I share (some parts) of the sentiment.

Fiddling with a VPS and dockers (and Linux generally) landed me my current job but there's a curve and now I feel the need to up my game with a deeper knowledge and understanding of the different pieces and of the overall picture. Otherwise I am just another admin bash monkey.

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

#102
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 guess rsync ;)

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

#103
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…

The problem with AWS is that you can’t really do anything without understanding 1. IAM, and 2. VPCs/networking. And these are probably the two most complicated parts. For DIY you’re probably best off avoiding AWS

You can do a lot with EB for simplistic projects. But yes without that you are in for a world of pain using anything else

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

#104
Great write up! Tip I learned this week when I migrated my VPS [1]: when dumping MySQL/MariaDB databases for disaster recovery, dump the grants (aka database user rights) with the pt-show-grants tool.

You don't want to import the mysql table itself on a fresh MySQL/MariaDB installation, it's a headache. So dump all your tables to SQL (raw data) and dump your user grants/rights with pt-show-grants (which in itself creates a small SQL file) that you easily import in MySQL/MariaDB.

[1] https://j11g.com/2021/12/28/migrating-a-lamp-vps/

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

#105
post #70
post #67

Earlier quoted context omitted.

> Is there any sort of comprehensive infra setup guide out there? This would be the AWS certification at their different levels.

I would tend to disagree. First, because not everyone is on AWS. Second, because even for people on AWS, some of a company's infra isn't on AWS (e.g. gmail). Third because not every infra setup work has an AWS tool. To take a personal example, we use multiple infra providers. Some of our infra is gmail (currently working on automating it with terraform). Some of it is other infrastructure providers that aren't US-bas…

What’s the “automating gmail with terraform” angle? G-suite automation? Or GCP?

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

#106
post #70
post #67

Earlier quoted context omitted.

> Is there any sort of comprehensive infra setup guide out there? This would be the AWS certification at their different levels.

I would tend to disagree. First, because not everyone is on AWS. Second, because even for people on AWS, some of a company's infra isn't on AWS (e.g. gmail). Third because not every infra setup work has an AWS tool. To take a personal example, we use multiple infra providers. Some of our infra is gmail (currently working on automating it with terraform). Some of it is other infrastructure providers that aren't US-bas…

Can you elaborate on the terraform automation for gmail?

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

#107
post #54
post #13

Easy setup with: - traefik (nginx proxy with auto letscencrypt) - portainer (docker container management) - fail2ban (basic security) - logwatch (server / security stats by mail) - munin (server stats) - restic (cloud backup) - unattended-upgrades (auto install security updates) - apticron (weekly info) - n8n (automatisation for e.g. quick info via telegram, if something not work) Run every app that you want in your…

Wow so easy, only 9 different services. Then there's the underlying OS, managing hardware & network setup. Also need to make sure your network provider actually allows you to host (commercially?) in your own home. And ensuring that you have a static ip address for your server. So easy :')

I think I’ve had the same IP address from my cable company for more than a decade now. (Regular old cable modem user with a dynamic, but unchanging, IP address.)

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

#108
post #18

Instead of recording the “docker run“ commands, you might want to have a look at docker-compose

Came here to say this! Honestly, my into to docker-compose came when I realised I was starting to do the same thing (saving 'run' commands). Small learning curve for the yaml structure, but well worth it (and honestly I think it is easier to visualize the deployment when it is all nicely laid out in the compose file). Pretty much the only way I use docker now. (Also has a bonus of not really adding a bunch of overhead or complex. Just does what you need for a basic multi-container deploymnet and no more.)

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

#109
post #81
post #65

Earlier quoted context omitted.

A lot of it is usually setup issues, i.e. either not enabling power saving features or hardware incompatibilities causing them to not be used. E.g. some mainboards ship with efficient power states disabled in BIOS. EDIT: e.g. for an optimized system with Ryzen 9 5950X and RTX 2070 Super apparently 40 W is doable for "sitting idly on Windows Desktop" according to reputable tests. Lower-class hardware can do less.

"40W is doable" is honestly not what I expected from your comment (I got the impression of both less and it being the default), but then again you didn't say it was "good", just "better". Fair enough, but this achievable idle consumption is still double of the peak consumption of a mid-range laptop. Either way, thanks for putting a number to it!

Ryzen 9 with 16 cores and fancy-ish GPU is not really a mid-range setup, as I said, you can go lower with weaker components. (the other numbers I had at hand quickly were from way below the 1200€ mentioned in the comment I replied to, and I thought it was a useful upper mark). And in reverse, 20W peak is low for a laptop - my Thinkpad 480s (which I guess you can argue is not a mid-range laptop, but not exactly a workstation beast either) peaks more at 40.

The desktop comparison to many laptops is more a mini-ITX based, embedded-graphics box with e.g. a quad-core CPU. There idle Desktop is going to be worse than laptops, but people tend to overestimate how much power a desktop system actually has to use if it's built well. Modern CPUs are efficient at power-saving, PSUs have gotten better, ...

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

#110
post #62

Earlier quoted context omitted.

That's great, but from an ecological perspective, repurposing second-hand hardware will always have more benefits than producing new "green" hardware, as most of the energy spent across the lifecycle of a computer happens during production. Buying a raspberry pi for selfhosting is certainly not greener than repurposing your old desktop/laptop. Although i have to admit the economic incentives are skewed due to foundri…

Where did you read that? It doesn't sound implausible, but if we're talking 70W idle for a 24/7 server, that does add up so I'd be interested in where the cut-off point is. Edit: just realized the 70W figure is in a sibling thread, not a (grand)parent, but I'm still interested regardless!

Some sources, not very recent but with great links to more detailed studies: https://css.umich.edu/factsheets/green-it-factsheet https://www.fcgov.com/climatewise/pdf/computers.pdf

Arguably, none of these account for the pollution due to extraction/refinement of materials, which is another concern raised with building more stuff. Recycling is also a polluting process (usually less so than new extraction) but unfortunately most electronics is never recycled and R&D in the hardware world is mostly focused on raw performance and does not even try to optimize for recyclability.

If any government cared at all about climate change, they would mandate hardware manufacturers to publish hardware sheets (for long-term maintenance and interoperability [0]), outlaw throwaway single-purpose computers (as opposed to flashable general-purpose computers [1]) and planned obsolescence, and invest massively in two key areas:

- green IT R&D: there's very little universities around the world working on this, and they operate on a shoestring budget

- public-service repair shops for electronics: it's ridiculously hard (or expensive) to find electronics repair services even in big cities, but having skilled people do a 1$ part change on a device that would otherwise be thrown away (eg. soldering a new micro-USB connector or changing a burnt capacitor) goes to great lengths to extend the lifetime of existing devices

I'm interested if people have more links/resources to share on that topic!

[0] https://www.usenix.org/conference/osdi21/presentation/fri-ke...

[1] https://boingboing.net/2011/12/27/the-coming-war-on-general-...

Post reply on HN