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!
Docker really. If something goes bad, trash the container and start again without loosing your actual data.
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.
Great summary!
Why Debian or Ubuntu? (I have my own thoughts, but it would be useful to show even high-level reasons why they’re preferred).
Re: Backup - Backblaze has a great writeup on backup approach today. I’m a fan of cloud being part of the mix (I use a combo of local replication and cloud, to mitigate different risks). Getting people to include backup from the start will help them long-term, so great you included it!
- Docker
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.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
Perseverance
-