this post was submitted on 21 Jun 2024
109 points (95.8% liked)

Selfhosted

46182 readers
391 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

Not exactly self hosting but maintaining/backing it up is hard for me. So many “what if”s are coming to my mind. Like what if DB gets corrupted? What if the device breaks? If on cloud provider, what if they decide to remove the server?

I need a local server and a remote one that are synced to confidentially self-host things and setting this up is a hassle I don’t want to take.

So my question is how safe is your setup? Are you still enthusiastic with it?

(page 2) 25 comments
sorted by: hot top controversial new old
[–] [email protected] 1 points 10 months ago

@[email protected] I think we need to accept that unless self-hosting is your full time job, things can and will break. At some point you have to accept it and let it go.

Finally I know when I die, my spouse won't take care of my homelab and servers, all of it will go to the recycler.

[–] [email protected] 5 points 10 months ago

Not safe at all. I look for robustness. I prefer thinking about things that do not break easily (like ZFS and RAIDZ) instead of "what could possibly go wrong"

And I have never quite figured out how to do restores, so I neglect backups as well.

[–] [email protected] 5 points 10 months ago* (last edited 10 months ago)

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer Letters More Letters
DNS Domain Name Service/System
Git Popular version control system, primarily for code
HA Home Assistant automation software
~ High Availability
HTTP Hypertext Transfer Protocol, the Web
IP Internet Protocol
LVM (Linux) Logical Volume Manager for filesystem mapping
LXC Linux Containers
NAS Network-Attached Storage
PSU Power Supply Unit
Plex Brand of media server package
RAID Redundant Array of Independent Disks for mass storage
RPi Raspberry Pi brand of SBC
SBC Single-Board Computer
SSH Secure Shell for remote terminal access
VPS Virtual Private Server (opposed to shared hosting)
ZFS Solaris/Linux filesystem focusing on data integrity
nginx Popular HTTP server

15 acronyms in this thread; the most compressed thread commented on today has 3 acronyms.

[Thread #821 for this sub, first seen 21st Jun 2024, 17:05] [FAQ] [Full list] [Contact] [Source code]

[–] [email protected] 35 points 10 months ago (1 children)

Right now I just play with things at a level that I don't care if they pop out of existence tomorrow.

If you want to be truly safe (at an individual level, not an institutional level where there's someone with an interest in fucking your stuff up), you need to make sure things are recoverable unless 3 completely separate things go wrong at the same time (an outage at a remote data centre, your server fails and your local backup fails). Very unlikely for all 3 to happen simultaneously, but 1 is likely to fail and 2 is forseeable, so you can fix it before the 3rd also fails.

[–] [email protected] 12 points 10 months ago (1 children)

Exactly right there with the not worrying. Getting started can be brutal. I always recommend people start without worrying about it, be okay with the idea that you're going to lose everything.

When you start really understanding how the tech works, then start playing with backups and how to recover. By that time you've probably set up enough that you are ready for a solution that doesn't require setting everything up again. When you're starting though? Getting it up and running is enough

[–] [email protected] 5 points 10 months ago (1 children)

Gonna just stream of consciousness some stuff here:

Been thinking lately, especially as I have been self-hosting more, how much work is just managing data on disk.

Which disk? Where does it live? How does the data transit from here to there? Why isn't the data moving properly?

I am not sure what this means, but it makes me feel like we are missing some important ideas around data management at personal scale.

load more comments (1 replies)
[–] [email protected] 7 points 10 months ago (2 children)

¯\_(ツ)_/¯ Yeah. It is kinda hard.

Backups. First and foremost.

Now once that is sorted, what if your DB gets corrupted. You test your backups

Learn how to verify and restore

It is a hassle. That’s why there is a constant back and forth between on prem and cloud in the enterprise

[–] [email protected] 2 points 10 months ago (1 children)

Nothing proves a backup like forcing yourself to simulate a recovery! I like to make one setting change, then make a backup, and then delete everything and try to rebuild it from scratch to see if I can do it and prove the setting change is still there

load more comments (1 replies)
load more comments (1 replies)
[–] [email protected] 7 points 10 months ago (3 children)

I got tired of having to learn new things. The latest was a reverse proxy that I didn't want to configure and maintain. I decided that life is short and just use samba to serve media as files. One lighttpd server for my favourite movies so I can watch them from anywhere. The rest I moved to free online services or apps that sync across mobile and desktop.

[–] [email protected] 4 points 10 months ago

Caddy took an afternoon to figure out and setup, and it does your certs for you.

[–] [email protected] 3 points 10 months ago

Unfortunately, I feel the same. As I observed from the commenters here, self-hosting that won't break seems very expensive and laborious.

[–] [email protected] 1 points 10 months ago* (last edited 10 months ago) (4 children)

Reverse proxy is actually super easy with nginx. I have an nginx server at the front of my server doing the reverse proxy and an Apache server hosting some of those applications being proxied.

Basically 3 main steps:

  • Setup up the DNS with your hoster for each subdomain.

  • Setup your router to port forward for each port.

  • Setup nginx to do the proxy from each subdomain to each port.

DreamHost let's me manage all the records I want. I point them to the same IP as my server:

This is my config file:

server {
    listen 80;
    listen [::]:80;

    server_name photos.my_website_domain.net;

    location / {
        proxy_pass http://127.0.0.1:2342;
        include proxy_params;
    }
 }

 server {
    listen 80;
    listen [::]:80;

    server_name media.my_website_domain.net;

    location / {
        proxy_pass http://127.0.0.1:8096;
        include proxy_params;
    }
}

And then I have dockers running on those ports.

root@website:~$ sudo docker ps
CONTAINER ID   IMAGE                          COMMAND                  CREATED       STATUS       PORTS                                                      NAMES
e18157d11eda   photoprism/photoprism:latest   "/scripts/entrypoint…"   4 weeks ago   Up 4 weeks   0.0.0.0:2342->2342/tcp, :::2342->2342/tcp, 2442-2443/tcp   photoprism-photoprism-1
b44e8a6fbc01   mariadb:11                     "docker-entrypoint.s…"   4 weeks ago   Up 4 weeks   3306/tcp                                                   photoprism-mariadb-1

So if you go to photos.my_website_domain.net that will navigate the user to my_website_domain.net first. My nginx server will kick in and see you want the 'photos' path, and reroute you to basically http://my_website_domain.net:2342. My PhotoPrism server. So you could do http://my_website_domain.net:2342 or http://photos.my_website_domain.net. Either one works. The reverse proxy does the shortcut.

Hope that helps!

[–] [email protected] 4 points 10 months ago (1 children)

fuck nginx and fuck its configuration file with an aids ridden spoon, it’s everything but easy if you want anything other than the default config for the app you want to serve

load more comments (1 replies)
[–] [email protected] 5 points 10 months ago

🤷‍♂️ I could spend that two hours with my kids.

You aren't wrong, but as a community I think we should be listening carefully to the pain points and thinking about how we could make them better.

load more comments (2 replies)
[–] [email protected] 3 points 10 months ago (3 children)

My setup is pretty safe. Every day it copies the root file system to its RAID. It copies them into folders named after the day of the week, so I always have 7 days of root fs backups. From there, I manually backup the RAID to a PC at my parents’ house every few days. This is started from the remote PC so that if any sort of malware infects my server, it can’t infect the backups.

[–] [email protected] 3 points 10 months ago

Off-site backups that are still local is brilliant.

[–] [email protected] 2 points 10 months ago

Pretty solid backup strategy :) I like it.

load more comments (1 replies)
[–] [email protected] 25 points 10 months ago (9 children)

Absurdly safe.

Proxmox cluster, HA active. Ceph for live data. Truenas for long term/slow data.

About 600 pounds of batteries at the bottom of the rack to weather short power outages (up to 5 hours). 2 dedicated breakers on different phases of power.

Dual/stacked switches with lacp'd connections that must be on both switches (one switch dies? Who cares). Dual firewalls with Carp ACTIVE/ACTIVE connection....

Basically everything is as redundant as it can be aside from one power source into the house... and one internet connection into the house. My "single point of failures" are all outside of my hands... and are all mitigated/risk assessed down.

I do not use cloud anything... to put even 1/10th of my shit onto the cloud it's thousands a month.

[–] [email protected] 3 points 10 months ago* (last edited 10 months ago) (2 children)

Different phases of power? Did you have 3-phase ran to your house or something?

You could get a Starlink for redundant internet connection. Load balancing / fail over is an interesting challenge if you like to DIY.

[–] [email protected] 1 points 10 months ago (2 children)

Nope 240. I have 2x 120v legs.

I actually had verizon home internet (5g lte) to do that... but i need static addresses for some services. I'm still working that out a bit...

load more comments (2 replies)
[–] [email protected] 4 points 10 months ago (1 children)

In the US at least, most equipment (unless you get into high-and datacenter stuff) runs on 120V. We also use 240V power, but a 240V connection is actually two 120V phases 180-degrees out of sync. The main feed coming into your home is 240V, so your breaker panel splits the circuits evenly between the two phases. Running dual-phase power to a server rack is as simple as just running two 120V circuits from the panel.

My rack only receives a single 120V circuit, but it's backed up by a dual-conversion UPS and a generator on a transfer switch. That was enough for me. For redundancy, though, dual phases, each with its own UPS, and dual-PSU servers are hard ro beat.

[–] [email protected] 1 points 10 months ago

Exactly this. 2 phase into house, batteries on each leg. While it would be exceedingly rare for just one phase to go out... i can in theory weather that storm indefinitely.

[–] [email protected] 13 points 10 months ago (1 children)

It's quite robust, but it looks like everything will be destroyed when your server room burns down :)

[–] [email protected] 10 points 10 months ago* (last edited 10 months ago) (1 children)

Fire extinguisher is in the garage... literal feet from the server. But that specific problem is actually being addressed soon. My dad is setting up his cluster and I fronted him about 1/2 the capacity I have. I intend to sync longterm/slow storage to his box (the truenas box is the proxmox backup server target, so also collects the backups and puts a copy offsite).

Slow process... Working on it :) Still have to maintain my normal job after all.

Edit: another possible mitigation I've seriously thought about for "fire" are things like these...

https://hsewatch.com/automatic-fire-extinguisher/

Or those types of modules that some 3d printer people use to automatically handle fires...

[–] [email protected] 4 points 10 months ago (2 children)

Yeah I really like the "parent backup" strategy from @[email protected] :) This way it costs much less.

load more comments (2 replies)
load more comments (7 replies)
load more comments
view more: ‹ prev next ›