Homelab Setup
My servers setup at home
Hardware
I run two Raspberry Pi 4s' as servers currently.
NAS/media server
falcon
- โก Raspberry Pi 4 (8GB model)
- Ubuntu Server 20.04 LTS
- Overclocked to 2.0GHz
- ๐ Powered USB 3.0 hub
- TP-Link TL-UH700
- ๐ผ Primary storage
- Sandisk Ultra microSD card (8GB, boot)
- Crucial BX500 SSD (480GB, root)
- ๐ Secondary storage
- Seagate Expansion 4TB
- Seagate Barracuda 2.5" 1TB
- WD My Passport 1TB
- Sony HD-B1 1TB
- ๐ Gigabit ethernet
- TP-Link TL-SG1008D
- ๐ 3.5mm out...
- Fenda E200 Plus
Main server that runs the majority of my self-hosted apps, functions as a NAS and audio server using librespot
, shairport-sync
, and mpv
.
Runs (mostly in Docker):
- ๐ก Home Assistant
- ๏ฟฝ Grafana/Prometheus
- ๏ฟฝ๐ฝ Plex Media Server
- ๐บ Sonarr/Radarr
- ๐งฒ qBittorrent
DNS/proxy server
always-on
- โก Raspberry Pi 4 (4GB model)
- Ubuntu Server 20.04 LTS
- ๐ผ 32GB microSD card
- ๐ Gigabit ethernet
DNS/DHCP server, also handles the Traefik network proxy over Tailscale, more on that below.
Since this server runs on a SD card, log2ram
is used to store certain logs in-memory to reduce writes.
Runs (mostly in Docker):
Cloud VMs
- Oracle Cloud (A1 Compute)
- Google Cloud Platform (
e2-micro
) - Digital Ocean Droplets
DNS
AdGuard Home manages DNS and DHCP, as well as acts as the content-blocker in the network.
I use Google Public DNS over DNS-over-HTTPS as well as my ISP's DNS servers using AdGuard as well as Unbound, blocky, and dnsmasq.
Unified access
I use Tailscale to access all devices and services. All cloud VMs have their storages mounted locally using NFS, securely.
Some apps are hosted in cloud to balance system resources. I use Traefik to access them as if they're hosted locally, using the format http://<app>.<machine>.nt
.
This requires Traefik and containers on all VMs, with Traefik routers created locally (for each VM) that proxy requests to remote Traefik instances.
File management
Files are stored both in the cloud and locally.
Cloud storage
rclone is used to communicate with various cloud storages.
During system startup, two systemd files mount rclone remotes to /mnt/rc-drive
and /mnt/rc-crypt
and caches the entire file structure in memory.
Another systemd file uses mergerFS to create a mount at /mnt/mfs-drive
that combines the above two mount points with another local folder, that way all new files are created locally.
# SSD cache
/home/../drive-local ->-|
/mnt/rc-drive ---->----|
/mnt/rc-crypt ---->----|
# NFS mounts over Tailscale
/mnt/oc*-drive ---->----|
|
/mnt/mfs-drive <-------|
At 6AM everyday, a cron job runs a script that moves local content to the cloud.
Local storage
Also at startup, mergerFS combines all external drives and creates a single mount point at /mnt/mfs-knox
using a systemd mount file.
All disks are formatted in ext4
(with no reserved space) and mounted inside /mnt/pool
using fstab entries.