For this new year, I’d like to learn the skills necessary to self host. Specifically, I would like to eventually be able to self host Nextcloud, Jellyfin and possibly my email server too.
I’ve have a basic level understanding of Python and Kotlin. Now I’m in the process of learning Linux through a virtual machine because I know Linux is better suited for self hosting.
Should I stick with Python? Or is JavaScript (or maybe Ruby) better suited for that purpose? I’m more than happy to learn a new language, but I’m unsure on which is better suited.
And if you could start again in your self hosting journey, what would you do differently? :)
EDIT: I wasn’t expecting all these wonderful replies. You’re all very kind people to share so much with me :)
The consensus seems to be that hosting your own email server might be a lot, so I might leave that as future project. But for Nextcloud and Jellyfin I saw a lot of great tips! I forgot to mention that ideally I would like to have Nextcloud available for multiple users (ie. family memebers) so indeed learning some basic networking/firewalling seems the bare minimum.
I also promise that I will carefully read the manuals!
Lots of people have been talking about products and tools. It’s docker, tailscale, cloudflare proxmox etc. These are important, but will likely come and go on a long enough timescale.
In terms of actual skills, there’s two that will dramatically decrease your headaches. Documention and backup planning. The problem with developing those skills is, to my knowledge, they’ve only ever been obtained through suffering. Trying to remember how to rebuild something when you built it 6 months ago is futile. Trying to recover borked data is brutal. There’s no fail-safe that you haven’t created, and there’s no history that you haven’t written. Fortunately, these are also the most transferable skills.
My advice is, jump in. Don’t hesitate. The chops in docker/linux/networking will come with use and familiarity. If it looks cool, do it. Make mistakes. You will rapidly realise what the problems with your set up are. You will gain knowledge in leaps and bounds from breaking a thing vs learning by rote or lesson. Reframe the headaches as a feature, not a bug - they’re highlighting holes in your understanding. They signpost the way to being a better tech, and a more stable production environment.
The greatest bit about self hosting for me is planning the next great leap forward, making it better, cleaner, more robust. Growing the confidence in your abilities to create a system you can trust. Honing your skills and toolset is the entirety of the excercise, so jump in, and don’t focus on any one thing to master or practice before hand!
Networking is way more important than pretty much anything else. TCP/IP and http are going to stay for quite a while.
The ability to read, and maybe watch a video. And then persistence for some of the trial and error you will run in to. All skills you need can be picked up with the above.
Honestly, you just need to pick a video on follow along these days. There’s a load of YouTube videos out there that take you step by step.
Lewis rosman recently put out a 14-hour mega video of doing everything, well he might have made some controversial choices, The outcome is quite comprehensive.
Determination, patience, a willingness to learn anything you need to.
If you have those, in time, you will be able to get your lab up and running. I started mine with a minimal knowledge of Linux (I could install it from a USB and poke around). Now it’s the center of my families digital life.
You’ll get there in time.
Take the time to properly understand Linux file ownership and permission. Permission will be the cause of many issues you will encounter in you self-hosting journey on Linux. Make sure you know the basics of
chmod
(change permission) andchown
(change ownership), Linux users and groups. This will save you some head-scratching, but don’t worry, you will learn by doing !Remember that, if you setup everything right, especially with docker, running as root / with
sudo
is not required for any of the services you may want to run.Give Nextcloud AIO a shot. I installed bare metal the first time, but AIO has decreased my maintenance burden to next to nothing. Before that, it felt like every update would break my system. I’m a year or two into my transition from Linux nerd to self-hoster. I still fail at things on occasion, but I have learned a lot. I hope it goes as well or even better for you.
I’ve hosted NC for a decade, and the AIO was the first method that doesn’t make me dread updates. And I’ve used pretty much every method of installing it over the years, everything sucked.
I snapshotted every time before and update because I knew it was a crapshoot whether the update was going to crater the system, and I’d roll back and wait for a working update to come out. Before snapshotting, I had to fix borked updates about every second time.
You don’t need to be a programmer to selfhost.
The most important “skills” to have if you want to selfhost imo are:
-
Basic Networking knowledge
-
Basic Linux knowledge
-
Basic docker/docker compose knowledge
But I’d say to not get lost in the papers and just jump right in. Imo, the best way to learn how to selfhost is to just… Do it. Most everything is free and fairly well documented
Where’d you learn Docker basics? I pretty much have no clue what’s going on every time I try to even start.
https://docker-curriculum.com/
Best resource I found so far. I tried docker’s tutorial but it was not good at all.
Totally agree! I’m not a programmer and I have several services running in my home server. I’m just curious and have used Linux for a decade as a normal user. With just these 3 basic knowledge skills you’re good to go.
Perseverance
-
Docker really. If something goes bad, trash the container and start again without loosing your actual data.
Dokploy is a pretty easy web gui and is itself a docker container.
Makes it dead simple to manage multiple containers and domains. (Not for power users that need kubernetes level flexibility)
- Docker: You can practice on your main computer before complicating things with networking.
- How to set up a reverse proxy: DNS, certificates, etc. I recommend Caddy.
- Backups: If you use Docker Volumes, make sure you back those up too and test the backups.
To self-host, you do not need to know how to code.
One thing I would do differently is setup LDAP and OIDC so you can use the same authentication credentials for different apps (at least the ones that support them). I use LLDAP and Authelia for this purpose.
You don’t really need to know a specific language to self-host anything. But things like YAML, JSON, Docker, and some networking basic will go a long way.
If I could do anything different though, it would definitely be to write more documentation. Document the steps taking setting things up, log notes on when you have to fix something, archive webpages and videos that you used along the way. Currently doing that myself now after some time self-hosting.
One under-appreciated aspect of Docker is that it forces you to document all your setup steps in your dockerfile and docker-config files.
If you want to program something, the closest you’re gonna get to programming is Ansible and Bash scripts.
You might want to get self hosting hardware like Synology or the like if you’re not ready to dig.
Otherwise here’s some things you need to know:
- Docker
- Easy, consistent deployment of services in their own environments. Think a VM but with almost no overhead.
- Docker Compose
- Run docker containers with consistent configuration in files.
- Connect various containers to each other on the same or different networks.
- Get multiple containers to start together and talk to each other.
- Systemd
- Manage any service on Linux. If anything needs to start on boot, restart when crashed, start on timer, you want Systemd.
- You can manage your docker compose containers lifecycle via Systemd.
- NGINX/Apache/Caddy
- A web server for reverse proxy. You’d probably need one at some point, especially if you want HTTPS. Your services get hidden behind it.
- ZFS
- Reliable redundant storage. You’ll need storage. Use ZFS with 2-disk redundancy.
- Supports automatic snapshots for recovering from oopsies. E.g. deleted something or some software shat on your data.
- Can use recertified disks from serverpartsdeals.
- Can use USB disks or USB box with multiple disks. If you end up going the USB route, ask me for tested hardware.
- Backup system
- Something to do backup. There are many options.
- Ansible
- If you want to write code that describes your services and make them happen, you want Ansible. You write code (well YAML) and Ansible installs things, writes config files, sets up Systemd services, restarts things. It can be convenient especially if you have a lot of stuff and you want to be able to see all of your infrastructure in code in one place and be able to version it.
- Prometheus
- Monitoring your stuff. Is my backup service running? If not send me an email.
Oh and use Debian or Ubuntu LTS.
Ansible is nice but I’ll repeat (as I said in another thread) it’s kind of advanced and gives a much better return on investment if you manage several hosts, plan to switch hosts regularly, or plan to do regular rebuilds of the environment.
If you end up going the USB route, ask me for tested hardware.
Send these my way chief
As briefly as possible:
- Host side
- If you use Intel, all is well.
- If you use AMD…
- Prior to AM5
- Use an ASMedia PCIe USB card (StatTech, Sonnet)
- X570 is especially bad, though I’ve had some success with B350, when using the chipset ports. The CPU ports are all bad. Small form factor PCs often only expose CPU USB ports. They work with single disk per port but if you peg a port with a multi-disk box, they crap out regularly.
- Post AM5
- Have only tested USB4 on X870 and it’s solid.
- Prior to AM5
- Client side
- WD Elements / MyBook
- If you get disconnects under load and you’re not on a shit AMD USB host, the USB-SATA controller is overheating. Open them and ahere a heatsink on it. Drill a hole in the case above it for better ventilation. Disconnections will stop. If you don’t want to deal with any of that buy the item below.
- OWC Mercury Elite Pro Quad
- Well built, solid controllers, no issues over a year of testing. I have 2, hosting an 8-disk RAIDz2 and 2 hosting a 5-disk RAIDz2.
- Terramaster
- A friend bought a 6-bay and tore it down for me. It has the same controllers as the OWC in a similar topology. If it’s cheaper it might be OK. I can vouch for the OWC though.
- Cables
- Get name brand cables, ideally higher spec than what you’d need! They aren’t important for a single USB disk but running a 4-disk box can max out the port bandwidth. If the cable can’t handle it… errors. Casually transmitting 10Gbps via easily detachable cables and ports isn’t trivial.
- WD Elements / MyBook
Much appreciated 🙏
Gnarly stuff with the WD’s huh? Unfortunately I think that’s what I’ll end up having to put up with since I can’t really find the other options for a decent price around here.
Funny enough I was half-considering just using a bunch of WD Elements. You think the MyBooks might fare any better?I used a mix of Elements and MyBook for years. Upon opening to heatsink, I didn’t see any significant differences between them. They use ASMedia or Jmicron, mostly ASMedia. The overheating issue depends on ambient temp and load. I’ve had one machine in a basement never experience them. Either way the solution is pretty straightforward and cheap. Once heatsinked, I haven’t had a problem.
The cables they come with are good.
- Host side
- Docker
Persistence and reading comprehension.
There’s no need to learn Python or any programming language to self host stuff, you just need to be able to follow blog posts and run some Docker commands.
I’m a software dev and haven’t touched a single line of code on my NAS. Everything is docker compose and other config files.
Learning Linux is a great start.
Learning any coding language will help you understand a bit more about the programs will work, however there isn’t much need to actually learn a specific language unless you plan to add custom programs or scripts.
The general advice for email is don’t. It’s very risky to host and it’s a big target for spam. Plus there’s challenges getting the big companies to trust your domain.
However hosting things behind a VPN (or locally on your home network) can let you learn a lot about networking and firewalls without exposing yourself to much risk.
I have no direct experience with next cloud but I understand it can be hosted on Linux, you can buy a Synology NAS and run it in that, or use something like TrueNAS.
Personally my setup is on one physical server so I use Proxmox which lets me run 2 different Linux servers and trueNAS on one single computer through virtual machines. I like it because it lets me tinker with different stuff like home assistant and it won’t affect say my adblocker/VPN/reverse proxy. I also use Docker to run multiple services on one virtual machine without compatibility issues. If I started again, I’d probably have gotten bigger drives or invested in SSDs. My NAS is hard drives because of cost but it’s definitely hitting a limit when I need to pull a bunch of files. Super happy with wireguard-easy for VPN. I started with a proprietary version of openVPN on Oracle Linux and that was a mistake.
I feel like objecting to the “General advice about email is don’t” thing but I don’t know if I understand the objections well enough to refute them. I self host email for mspencer.net (meaning all requests including DNS are served from hardware in my living space) and I have literally zero spam and can’t remember the last time I had to intervene on my mail server.
On one hand: My emails are received without issue by major providers (outlook, gmail, etc) and I get nearly zero spam. (Two spam senders were using legitimate email services, I reported them, and got human-seeming replies from administrators saying they would take care of it.) And I get amusing pflogsumm (summarizes postfix logs) emails daily showing like 5 emails delivered, 45 rejected, with all of the things that were tried but didn’t work.
On the other: most of the spam prevention comes from greylist, making all new senders retry after a few minutes (because generally a legit MTA will retry while a spammer will not) and that delays most emails by a few minutes. And it was a bear to set up. I used a like 18 step walkthrough on linuxbabe dot com I think, but added some difficulty by storing some use and alias databases on OpenLDAP / slapd instead of in flat files.
But hey, unlimited mail aliases, and I’m thinking of configuring things so emails bounce if they seem to contain just a notification that terms and conditions are updated somewhere. I don’t know, cause some chaos I guess.
And I have no idea if my situation is persuasive for anyone because I don’t know what the general advice means. And I worry it’ll have the unfortunate side effect of making self hosting type nerds like me start forgetting how to run their own email, causing control of email to become more centralized. And I strongly dislike that.
I don’t know a bit about programming. Yunohost is a great place to start for self hosting a variety of services. For Jellyfin/downloading, I use Swizzin Community Edition. I like both of these projects because neither uses Docker lol. I tried some Docker based setups but could never get my head around it. YMMV.