Self-hosting can be understood as "running your own cloud". In a nutshell, you replace all these services for which you pay a monthly subscription with your own. You can either rent a Virtual Private Server (VPS), a computer that runs "in the cloud", for a unique monthly fee, or you run services on your own hardware, in which case it is up to you to guarantee data safety and service availability.
Choosing an Operating System
Once the hardware (real or virtual) is chosen, the Operating System (OS) is what will enable our services. Those not familiar with Linux might choose Windows Server. Otherwise, the "default" starter OS is Debian, as it has a wide community and is very stable (more than Fedora or Ubuntu).
I run Proxmox Virtual Environment, which is debian-based and provides a neat web interface to manage multiple Virtual Machines (VM) or containers on a single computer.
I use a Debian container (a form of optimized VM) to run services with docker compose, which allows me to use simple configuration files to create and run independent services in separate environments. This eliminates compatibility issues, if for example two services require different versions of the same dependency, or want to use the same port to listen for requests. It also means I never have to care about satisfying dependencies; docker packages do that for me.
Nginx Proxy Manager
Nginx Proxy Manager is a simple web interface that allows me to manage a reverse proxy. That means I can have multiple URLs pointing to the same IP address and port, and the reverse proxy then redirects the incoming connections to the right service depending on the requested URL. It also manages SSL certificates for me to ensure secure, encrypted connections. For example, I can access nextcloud.connaxio.com and jellyfin.connaxio.com instead of 18.104.22.168:11234 and 22.214.171.124:8090
Cloudflare-DDNS is a Dynamic DNS service, which means it keeps my URLs pointing to my (changing) IP address. This is an absolute must to be able to access my services reliably from everywhere, since my home IP address could change at any time. There are other options for this, sudh as DuckDNS, which is also free.
Wireguard is Virtual Private Network (VPN) protocol that allows me to create an encrypted tunnel from my phone or computer to my server, and then access my home network or the internet as if I was at home. I use it to browse the web on public networks, which are not always safely configured, and to access some services I don't want to be accessible from the broader internet. Nginx Proxy Manager's admin UI, for example, is not exposed to the internet and requires the VPN connection to be accessed from outside the server's home network.
Portainer is a docker container management interface. I run it as a docker container, which I find a bit funny. It gives me a quick overview of that services (containers) are running. This is also kept behind the VPN.
Homepage provides a neat little dashboard for the server. It gives me a way to quickly look at the state of the server and its services.
Nextcloud AIO is an office and productivity suite that replaces Microsoft 365. File storage and synchronisation, web document editing with Collabora / Libre Office, and video conference and calls are included. There are also cool plugins for just about anything, from CRM to drawing diagrams. It can also act as a mail client, calendar, contact book, notepad and tasks dashboard. Nextcloud is possibly the most used self-hosted service.
Jellyfin is a media streaming service for Movies, TV Shows, Books, Photos, Music... You get the idea. It is similar to PLEX, though I enjoy having my books easily accessible along with other media in a single service. By having my media files set up as an external storage in Nextcloud, I can access them with Jellyfin and stream them to any device with their desktop and phone applications. That way, I get both a backup with Nextcloud and a nice streaming and download interface with Jellyfin.
Servarr can be used with a BitTorrent client to provide a download-on-request feature for Jellyfin from Torrenting and Usenet sources. New content is automatically added to the Jellyfin library according to predefined sorting and naming rules, so your library stays organized as new content is added.
Calibre is an unparalleled eBook library management tool, and the docker container provides a web interface that I can access from another computer. It can act as a middleman between Readarr and Jellyfin. Calibre helps me manage my eBooks' metadata efficiently, and makes my eBooks available in a uniform way. It is definitely not meant for browsing and reading books, though; that's what Jellyfin is for.
Adguard Home is a DNS filter. It blocks ads, trackers, phishing, and selected websites and content, if you want it to. A DNS filter is the modern version of firewalls.
Other services all follow the same methodology: find a docker compose example file, adjust it a little bit, add a URL to you DNS and Nginx Proxy Manager settings, and start the service. Using Docker means never having to deal with environment conflicts, so you can run as many services as the server can handle, which can be quite a lot!
Additional Virtual Machines
Home Assistant Operating System
HAOS is an open source home automation server that integrates with thousands of devices from many, many brands. Instead of having a different app for each brand of device, I just use their integrations in Home Assistant and add them to a unified dashboard. It even has voice command integrations, and running the server locally instead of in the cloud gives me better control over my privacy, as well as better reliability. I don't need Google or the Internet to work for my lights to turn on and off.
I usually use Node-RED to create more complex automation rules. It has a nice and intuitive drag-and-drop interface that allows me to easily link different services together. For example, I can tell it to turn on a fan via a smart plug if the CO2 level provided by another sensor rises too high, or tell it to water the garden for 12 minutes every morning, 30 minutes after sunrise, unless the soil moisture level is already high enough.
Running Home Assistant in a separate VM from all the other services grants me easy access to Home Assistant add-ons and supervisors. That's actually the main reason why I run Proxmox VE as my main OS instead of just running Debian directly on the hardware.
Storage sharing, redundancy, and backup
Proxmox VE makes the creation of ZFS storage very easy. ZFS is an enterprise-grade file system that includes data protection features out-of-the-box. I use it to run a simple mirror architecture, where all data is duplicated on two drives. If one drive fails, I just need to pop in a new one and the data will be copied there.
A script periodically runs a rsync command to copy the mirrored drives' content to a third, separate drive. I don't use a versioning system for that, since Nextcloud already provides a versioning system for my files and I just assume that if the backup runs properly, then that means the underlying drives and data are also functional.