homelab icon indicating copy to clipboard operation
homelab copied to clipboard

My Homelab setup

Homelab Setup

My servers setup at home

  • Homelab Setup
    • Hardware
      • NAS/media server
      • DNS/proxy server
      • Cloud VMs
    • Unified access
    • File management
      • Cloud storage
      • Local storage

Hardware

I run two Raspberry Pi 4s' as servers currently.

NAS/media server

falcon

  • ⚡ Raspberry Pi 4 (8GB model)
    • Ubuntu Server 22.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):

🔗 Docker Compose

  • 💡 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):

🔗 Docker Compose

Cloud VMs

  • Oracle Cloud (A1 Compute)
  • Google Cloud Platform (e2-micro)
  • Digital Ocean Droplets

🔗 Docker Compose


DNS

AdGuard Home manages DNS and DHCP, as well as acts as the content-blocker in the network.

I use Cloudflare Gateway DNS over DNS-over-HTTPS, which is similar to 1.1.1.1 but supports EDNS Client Subnet in addition to it being a managed DNS service.

Cloudflare Gateway DNS

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.