Live data from Hacker News

Ask HN: How can a total beginner start with self-hosting?

news.ycombinator.com

141–150 of 194 posts

Re: Ask HN: How can a total beginner start with self-hosting?

#141
If you don’t mind the security, off-the-shelf NAS boxes, such as synology, offer all kinds of self hosting applications that you might need. Photos, videos, plex, backups, torrent, MS office replacement, chat, git, etc.

But, boy, they have huge attack surface, with so much PHP code, web servers, databases, etc running on the box.

Re: Ask HN: How can a total beginner start with self-hosting?

#142
post #136

Earlier 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.

Generally I try to avoid VPSs. They are long lived, it's easy to accumulate undocumented state, and have substantial memory, disk I/O, and network I/O overhead. You may end up with a years old VPS with many changes over the years, and ugly things accumulate. Maybe you built a package from source, but now it's got a security vulnerability, but your forgot it's there. So apt upgrade doesn't help. Not to mention any security fix assumes you aren't already compromised. A rebuilt container (I suggest proxmox or docker) rebuilt will remove any previous existing compromise. Sure you can clone an old VPS... but you still don't know exactly what changes have been made, and if it was compromised the clone is as well.

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?

#143
If your first requirement is to build a solid foundation in networking I'd suggest finding study materials for the N+ Certification from CompTIA (https://www.comptia.org/certifications/network). It is vendor neutral and is intended as an entry point into a career in IT Infrastructure/networking.

Re: Ask HN: How can a total beginner start with self-hosting?

#144
post #38

I 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…

Plex is pretty good for viewing stored video and photos (pre-generated thumbnails and video transcoding + preview), while NextCloud is pretty good at syncing them. Install both and point plex to the synced photos and videos directory in the server.

Re: Ask HN: How can a total beginner start with self-hosting?

#145
Howdy! 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 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?

#146
post #38

I 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…

I'm the author of PhotoStructure: AMA, or hop into our discord! https://photostructure.com/go/discord

Re: Ask HN: How can a total beginner start with self-hosting?

#147

Howdy! 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…

Extremely helpful. Thanks for the tips!

Re: Ask HN: How can a total beginner start with self-hosting?

#148

I 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.

You could put your services behind a reverse proxy such as Traefik with forward-auth and expose it to port 443 (HTTPS) on your router, or (that's what I do and am happy with) use the cloudflared [1] demon to connect your services to Cloudflare where they can be protected behind Cloudflare Access using an SSO provider such as Okta (or Github or Google) for authentication. This method does not require you to expose any ports on your router and can all be done on the free/dev tiers of Cloudflare and Okta.

[1]: https://hub.docker.com/r/cloudflare/cloudflared

Re: Ask HN: How can a total beginner start with self-hosting?

#149
> I can HERPaDERP install packages on client and server, and copypasta configs I don’t understand. Where do I go to understand?

Other 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?

#150

I'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…

I'm so sad that Sandstorm.io is a zombie. The novel capability-based security infrastructure was awesome.
Post reply on HN