But, boy, they have huge attack surface, with so much PHP code, web servers, databases, etc running on the box.
Ask HN: How can a total beginner start with self-hosting?
141–150 of 194 posts
Re: Ask HN: How can a total beginner start with self-hosting?
#142Earlier quoted context omitted.
Generally new admins tend towards creating physical or virtual machines, logging in as root, editing files, starting services, and backing them up. Which is fine, a great way to learn, a less great way to be in production. Upgrades can be painful, it's easy to break things is non-obvious ways, and there's no easy "undo". Generally I'd recommend either using containers and maintain your build scripts in git, or use so…
Really good advice. I still have flashes of “Ohhhh righhhhhht it’s a VIRTUAL machine---I can...” make a snapshot, clone it and test new stuff, etc. etc. etc. I’ll be happy when it fully sinks in.
Much better to have docker (or similar) build script, a ansible play, or a puppet manifest. They will clearly list needed packages, config files, services, at least in puppet's case you'll have the "trifecta". The trifecta is a mapping between a service, the required packages, and the config files. So Puppet can notice a config file change, restart a service, and if a package is missing install it. So puppet is to a degree self healing, even when an admin edits a file on the guest/container/VPS instead of in puppet and it's fixed on the next puppet run.
That way years later it's not big deal to upgrade the OS, or replace one piece of the stack with another, then apply ALL the changes you've done so far, and test the result.
I can tell you from experience it's a nightmare to inherit somebody else's VPS that has 3 python installs, tons of services, and requires manual intervention on boot to start/stop services. Would be MUCH better if it was just managed by config management and everything except the base OS is controlled by ansible/puppet.
Often custom VPSs are called pets or snowflakes (with a negative connotation), much better to make them easy to replace as needed, like cows (with a positive connotation) as the saying goes.
Re: Ask HN: How can a total beginner start with self-hosting?
#143Re: Ask HN: How can a total beginner start with self-hosting?
#144I do not know of an opinionated beginners guide, but would recommend browsing r/selfhosted and r/homelab a bit. Lots of these and similar questions are answered on a regular basis. Some starting points - photos: NextCloud - git: Gitea - BitWarden: Vaultwarden (even if you deploy this locally you want a SSL certificate as clients will refuse to connect otherwise) I'd suggest using official docker images to get started…
> - photos: NextCloud If you don't mind horrible experience viewing photos/videos via nextcloud, go on. In my case this was unusable. Thumbnails not pregenerated even after trying (Yeah, didn't spend whole day on that issue) and generates on the fly. So viewing larger directory is... rubbish. Videos don't play as nice not to say they don't even have thumbnails. Feels like "guest book" from 2000 - no features that aut…
Re: Ask HN: How can a total beginner start with self-hosting?
#145I've been self-hosting email and photos and playing with reverse proxies and VPNs for several decades.
There's always a ton to learn about. This is a journey, not a destination.
The biggest thing to avoid is being overwhelmed. It's super easy to just throw in the towel and give up because there are gobsmacking numbers of alternatives to everything, and everyone has _opinions_.
I've got a couple bits of general advice that should be fairly universal truths, and should help guide your journey:
1. Storage is important for all your bullet items. Know that lots of copies keeps stuff safe. Have an offline and, if possible, offsite backup of the stuff you'd be sad if you lost. Encrypt the private stuff (before it goes off to the cloud, ideally). Read more here: https://photostructure.com/faq/how-do-i-safely-store-files
Once you know you're stuff isn't going to disappear (because you have backups), it makes updates and trying out new stuff much less stressful!
2. Reduce your externally-available footprint. Ideally, the only access to any of your servers should be through a VPN between your phone/laptop and your server. The less that is externally available, the better. (hint: turn off your Synology's cloud access stuff if possible, asap).
3. Harden your servers. I wrote up a basic guide, and there are ton of others--but only run commands you understand. https://forum.photostructure.com/t/server-hardening-for-begi...
4. The more the exotic your setup, the less likely things will work out of the box, and the harder it will be for someone else to reproduce your issue.
5. Look for friendly communities that will, ideally, let you bounce ideas off of them and guide you to making fewer mistakes. There are several subreddits (like /r/selfhosted)--just remember to ignore the trolls. PhotoStructure has a discord, but it has several orders of magnitude fewer members than the popular subreddits.
6. Take any tutorial with a grain of salt. A frustrating majority are outdated. Many were written by interns or by people trying to figure it out for themselves, but in any event, aren't experts.
Good luck!
Re: Ask HN: How can a total beginner start with self-hosting?
#146I do not know of an opinionated beginners guide, but would recommend browsing r/selfhosted and r/homelab a bit. Lots of these and similar questions are answered on a regular basis. Some starting points - photos: NextCloud - git: Gitea - BitWarden: Vaultwarden (even if you deploy this locally you want a SSL certificate as clients will refuse to connect otherwise) I'd suggest using official docker images to get started…
> - photos: NextCloud If you don't mind horrible experience viewing photos/videos via nextcloud, go on. In my case this was unusable. Thumbnails not pregenerated even after trying (Yeah, didn't spend whole day on that issue) and generates on the fly. So viewing larger directory is... rubbish. Videos don't play as nice not to say they don't even have thumbnails. Feels like "guest book" from 2000 - no features that aut…
Re: Ask HN: How can a total beginner start with self-hosting?
#147Howdy! I'm the author of PhotoStructure, which is mentioned on this post a couple times already. I've been self-hosting email and photos and playing with reverse proxies and VPNs for several decades. There's always a ton to learn about. This is a journey, not a destination. The biggest thing to avoid is being overwhelmed. It's super easy to just throw in the towel and give up because there are gobsmacking numbers of…
Re: Ask HN: How can a total beginner start with self-hosting?
#148I do not know of an opinionated beginners guide, but would recommend browsing r/selfhosted and r/homelab a bit. Lots of these and similar questions are answered on a regular basis. Some starting points - photos: NextCloud - git: Gitea - BitWarden: Vaultwarden (even if you deploy this locally you want a SSL certificate as clients will refuse to connect otherwise) I'd suggest using official docker images to get started…
> As long as you run services locally on your Synology (assuming it supports docker) and don’t expose them to the Internet How do I do all this while exposing it to the internet? I want to host stuff for my friends and family without putting them on a VPN to my house.
Re: Ask HN: How can a total beginner start with self-hosting?
#149Other commenters have a good bunch of resources on what to do, but if you're really interested in understanding the fundamentals imo there's no better way than to RTFM. Sometimes the manual will have things you don't understand, and then you'll have to google that thing.
For networking I highly recommend the RHEL docs (https://access.redhat.com/documentation/en-us/red_hat_enterp...). There's a big chunk that's useless to you (infiniband, etc), but the basics of the TCP/IP stack is really good to know. It looks like ubuntu has some introductory material too at (https://ubuntu.com/server/docs/network-introduction) with links to more in-depth resources.
For the rest of linux, again I highly recommend the redhat docs here https://access.redhat.com/documentation/en-us/red_hat_enterp.... They're very will written and comprehensive, so feel free to skip all the stuff that you don't care about (printers, SElinux, etc).
Re: Ask HN: How can a total beginner start with self-hosting?
#150I'd recommend you to check out the specialized self hosting distros and systems such as FreedomBox , Sandstorm.io, yunohost or Cloudron . I have not used it myself, so i cant recommend which system to use. However i have gone trough the pain of setting up loads of self-hosted apps. Especially if you really want to use your system, not maintain it all the time you will search for the most easy solution. There is nothi…