Live data from Hacker News

Self-Hosting like it's 2025

kiranet.org

171–180 of 240 posts

Re: Self-Hosting like it's 2025

#171
post #91
post #75

I can self host many applications, but their security must be outsourced to a company. I don’t have time to keep on top of vulnerabilities. Cloudflare Tunnels is a step in the right direction, but it’s not end to end encrypted. The question is then, how to secure self hosted apps with minimal configuration, in a way that is almost bulletproof?

> security must be outsourced to a company. I don’t have time to keep on top of vulnerabilities. If the software you host constantly has vulnerabilities and something like apt install unattended-upgrades doesn't resolve them, maybe the software simply isn't fit for hosting no matter what team you put on it. That hired team might as well just spend some time making it secure rather than "keeping on top of vulnerabilit…

There's only a handful of web apps packaged in the OS repo. Even wildly popular software like WordPress and Drupal you need to use their built in facilities or manually apply outside the OS update manager

Re: Self-Hosting like it's 2025

#172
post #169
post #79

Earlier quoted context omitted.

Why would tuning be necessary for a regular setup, does it come with such bad defaults? Why not upstream those tunes so it can work out of the box? I remember spending time on this as a teenager but I haven't touched my MariaDB config in a decade now probably. Ah no, one time a few years ago I turned off fsyncing temporarily to do a huge batch of insertions (helped a lot with qps, especially on the HDD I used at the…

PostgreSQL defaults (last I looked, it's been a few years) are/were set up for spinning storage and very little memory. They absolutely work for tiny things like what self-hosting usually implies, but for production workloads tuning the db parameters to match your hardware is essential.

Correct, they're designed for maximum compatibility. Postgres doesn't even do basic adjustments out of the box and defaults are designed to work on tiny machines.

Iirc default shared_mem is 128MB and it's usually recommended to set to 50-75% system RAM.

Re: Self-Hosting like it's 2025

#173

Earlier quoted context omitted.

Put it on a zfs dataset and back up data on the filesystem level (using sanoid/syncoid to manage snapshots, or any of their alternatives). It will be much more efficient compared to all other backup strategies with similar maintenance complexity.

Filesystem backups may not be consistent and may lose transactions that haven't made it to the WAL. You should always try to use database backup tools like pgdump.

If a filesystem backup isn't consistent, the app isn't using sync correctly and needs a bug report. No amount of magic can work around an app that wants to corrupt data.

For most apps, the answer is usually "use a database" that correctly saves data.

Re: Self-Hosting like it's 2025

#174

The only thing that holds me back for self hosting is Postgres. Has anyone managed to get a rock solid Postgres setup self managed? Backups + tuning?

https://pgtune.leopard.in.ua/ is a pretty good start. There's a couple other web apps I've seen that do something similar.

Not sure on "easy" backups besides just running pg_dump on a cron but it's not very space efficient (each backup is a full backup, there's no incremental)

Re: Self-Hosting like it's 2025

#175

The only thing that holds me back for self hosting is Postgres. Has anyone managed to get a rock solid Postgres setup self managed? Backups + tuning?

I was using straight filesystem backups for a while, but I knew they could be inconsistent. Since then, I've setup https://github.com/prodrigestivill/docker-postgres-backup-lo... , which regularly dumps a snapshot to the filesystem, which regular filesystem backups can consume. The README has restore examples, too I haven't needed to tune selfhosted databases. They do fine for low load on cheap hardware from 10 years…

Inconsistent how? Postgres can recover from a crash or loss of power which is more-or-less the same as a filesystem snapshot

Re: Self-Hosting like it's 2025

#176

The only thing that holds me back for self hosting is Postgres. Has anyone managed to get a rock solid Postgres setup self managed? Backups + tuning?

What is your RTO/RPO?

RTO - best effort RPO - wait? You guys have backups and test then??

Re: Self-Hosting like it's 2025

#177
For our startup, I decided we’d self-host as much as possible. We have one server in our office with Traefik for “firewall” and SSL termination, and our backend services are handled by Incus. Our only paid services are Tailscale and Postmark. We run things like forgejo and mattermost for our internal development work, as well as things like elasticsearch and kibana for observability into our products (100ish embedded devices distributed globally). So far so good.

Re: Self-Hosting like it's 2025

#178
post #11

My peace of mind comes from my self hosting in 2025 looking the same as my self-hosting in 2005 (except a move to systemd). I haven't even re-installed my workstation OS since 2006 or so.

I'm glad I'm not configuring php-fpm and compiling PHP add-ons from source. Someone else can shove that in a tarball (Docker image) for me

Re: Self-Hosting like it's 2025

#179

Earlier quoted context omitted.

Exactly, my first reaction was "I should write a blog post about why I still use Docker Swarm". I deploy to single node swarms, and it's a zero boiler plate solution. I had to migrate services to another server recently, and it was really painless. Why oh why doesn't Docker Swarm get more love (from its owners/maintainers and users)?.... Edit: anyone actually interested in such a post?

I'd be interested. Might be a strange question but I'll throw it out there, I seem to have a hard time finding a good way to define my self hosted infrastructure nodes and which containers can run on them, have you run into/have a solution for this? Like I want my database to run on my two beefier machines but some of the other services could run on the mini pcs.

I am running one-node swarms, so everything I deploy is running on the same node. But from my understanding you can apply labels to the nodes, and limit the placement of containers. See here for an example (I am not affiliated to this site): https://www.sweharris.org/post/2017-07-30-docker-placement/

Re: Self-Hosting like it's 2025

#180
post #94
post #60

If you self host, do not use containers and all those things. Just use a static site generator like zola or hugo and rsync to a small VPS running caddy or nginx. If you need dynamic thing, there are many frameworks you can just rsync too with little dependencies. Or use PHP, it's not that bad. Just restrict all locations except public ones to your ip in nginx config if you use something like wordpress and you should…

What I'm reading is not to use containers for a web server, which makes sense because web servers have had vhosts since forever and you can host any number of sites on there independently already But what about other services, like if you want a database server as well, a mail server, etc.? I started using containers when I last upgraded hardware and while it's not as beneficial as I had hoped, it's still an improvem…

Containers are fine. Run them on a Linux host to save yourself some headaches
Post reply on HN