self-hosting.xml (5271B)
- <entry>
- <title>Some tips/opinions about self-hosting</title>
- <link rel="alternate" type="text/html" href="https://hacktivis.me/articles/self-hosting"/>
- <id>https://hacktivis.me/articles/self-hosting</id>
- <published>2021-04-07T21:11:12Z</published>
- <updated>2021-04-07T21:20:10Z</updated>
- <link rel="external replies" type="application/activity+json" href="https://queer.hacktivis.me/objects/7bb0bd82-a128-4797-af41-0c5eed4d37eb" />
- <link rel="external replies" type="text/html" href="https://queer.hacktivis.me/objects/7bb0bd82-a128-4797-af41-0c5eed4d37eb" />
- <content type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
- <p>
- I've started self-hosting in 2012 because I wanted to put my own stuff on the internet without depending on some garbage-of-the-day gratis service and renting an extra machine (managed or not) didn't make sense, specially back when I was a minor.<br />
- Here is some tips/opinions about how to do it and avoid getting in the same issues as me and definitely others.
- </p>
- <h2>It doesn't matters if it's down for the others, make it for yourself first</h2>
- <p>
- I used to care more than I should about uptime, after all it's the most important thing when you host services, right? Well, no.
- When self-hosting you should just prioritize having it as reachable and as reliable as you actually need. A human probably only has 60% of uptime, they sleep.<br />
- If you want something with more uptime see with friends with other sleep rythms, if you want something close to 99% of uptime you don't want self-hosting.
- </p>
- <h2>Put some redundancy on your disks; Automate the backups; prefer to edit locally and push</h2>
- <p>This is likely the most ignored thing ever in premade self-hosting setups I see around on the internet.</p>
- <p>
- You need to mirror the disks holding data that you need constantly enough that you don't want to loose access to it for a long period of time (many hours, easily multiple days), typically that's the operating system and related software, the databases, the served data, …
- Typically you should use sofware raid solutions with reliability in mind like ZFS there.
- </p>
- <p>
- You need to automate the backups, I tend to go with cron, shell scripts and rsync or tar and avoid turn-key solutions like borgbackup like the plague because of their lack of standardization/ubiquity, which helps for data recovery.<br />
- </p>
- <p>On that topic there there is two ways to do backups to another machine, pushing or pulling:
- <ul>
- <li>pushing allows to avoid giving administation rights to the backup machine, which needs to be trusted but when this is done shouldn't be internet-facing;</li>
- <li>pulling allows to run everything with the least administration rights and can allow to use a less trusted machine, specially with using some encryption (be careful of the solution used there though, it needs to be reliable)</li>
- </ul>
- </p>
- <p>
- A very easy and efficient way to avoid having to do extra backups is to edit data locally under version control (ie. git) and push to the server for updates. This way you always have an extra copy and it allows to work offline.
- </p>
- <h2>Avoid SBCs (ie. RaspberryPi) and prefer PCs</h2>
- <p>Yet another thing where premade self-hosting setups tend to fail.</p>
- <p>
- In their their generic sense, for example here a Sun Workstation or a Mac is a PC. PCs offers easy repairability and extensability.
- If I need more SATA ports or more USB ports on a PC without sacrifying speed I can put a PCI(e) card, the available boards also have much more ports to begin with. This also goes with the disk redundancy part, you'll want at least 2 large storage units
- </p>
- <p>
- This also allows to boot on a standard operating system, so you don't need to grab an obscure operating system or one where you have to do compromises for installation or recovery, the usual ones just work.
- Which also means that you can swap-out the disks to a regular computer if some of your hosting hardware broke.
- </p>
- <p>
- I think the best premade self-hosting machine would be something similar to a NAS where if it's non-x86 it should still have the ability to boot a generic image.
- </p>
- <h2>It's a private service in your own space, you don't have to let everyone in</h2>
- <p>
- One thing you might have to learn the hard way when providing services is saying no on giving power (admin, moderation) to some people, well it's like in politics, don't give power to the ones asking for it.
- Give them to the ones that aren't asking it and have no reason to not have it.
- Transparency and Honesty (even when blunt) are nice things to have, this avoids a lot of drama.
- </p>
- <h2>The internet and its crowd are chaos incarnate</h2>
- <p>
- Don't try to regulate everything that comes in, specially in terms of politics, behavior or moderations. Either you let no one but yourself write content (this is why my blog doesn't and never will have comments) or you have to let go of some space for the chaos to happen.<br />
- Moderating all the content which comes in is hard and a good example is spam in emails, there is always some nasty ones which manage to get in.<br />
- Chaos will always be there, acknowledge it's existance or be prepared for things to not go your way.
- </p>
- </div></content>
- </entry>