Rebuilt my media server from scratch
retained text
Hey r/homelab, I spent the last few weeks rebuilding my media server, and drew the result. Everything runs on a single N100 mini-ITX board with Debian and Docker Compose, plus a small Proxmox box on the side for monitoring and DNS. **The short version** - **443 is the only open port.** Port 80 is closed, UPnP is off, IPv6 inbound blocked at the router. - **Pangolin** (Traefik inside) as the single entry point, with **PocketID** as identity provider: passkeys only, groups mapped to roles. - **Two access policies:** "Family" (requests (seerr), files) and "Admins" (the *arr stack, qui…). Apps with their own TV/phone clients (Plex, Jellyfin) skip SSO and use their own login. - **Admin tools (Arcane, Backrest, CrowdSec Manager) have no public DNS record at all.** They only resolve on my LAN, and over the VPN. - **Cloudflare in front of the web apps:** restricted to two countries, cloud-hosting networks challenged, AI crawlers blocked. Streaming (Jellyfin + Plex) and downloads (custom files app) stay DNS-only, per Cloudflare's terms. - **CrowdSec** reads Traefik's logs, with AppSec virtual patching. Repeat offenders get escalating bans and a Discord notification. - **qBittorrent lives inside gluetun's network namespace**: no tunnel, no traffic. - **Backups:** Backrest (restic) every night to an SSD on the router, with apps paused for a few seconds during the snapshot. Compose files are backed up to a private Git repo by Arcane. I may do offsite backups later too. - **Monitoring runs on a different machine** (Beszel hub on Proxmox), so a dead server still triggers an alert. **Things that bit me along the way** — maybe useful to someone: - **Attackers, attackers everywhere**. When I was about to setup Crowdsec, I saw 50k+ traffic in less than a few hours. Mostly GCP and OVHcloud, so mostly VPS (bots). Make sure to check that, it's scary. - **My router's IPv6 firewall was off by default, for a few years.** Every container port I had published was reachable from the internet over IPv6. Worth checking yours. - **Behind Cloudflare's proxy, CrowdSec would have banned Cloudflare instead of attackers**, until Traefik was told to trust Cloudflare's IP ranges (`forwardedHeaders.trustedIPs`), so the logs show real visitor IPs. - **`sniStrict: true` in Traefik:** scanners hitting the bare IP now fail at the TLS handshake, instead of getting a 404 and a certificate that can reveal your domain. **The one piece I'm building myself: file browser app** A small file browser for the media library, in the spirit of an old Apache directory listing but modern: browse folders, then download through short-lived signed links instead of exposing the files directly. You can grab a single file, a ZIP, a list for download managers like JDownloader, or share a whole folder for a limited time. It reads identity and roles straight from Pangolin's headers, so admins can rename and delete while family can only browse and download. It runs as two containers from the same image: one with read-write access behind SSO, and a separate, read-only one that serves the actual downloads. So the only part exposed without a login can never modify anything. I made this because all the other similar solutions wouldn't fit my needs. **Still on the list:** a dead-man's switch for when the whole house goes offline, and an off-site copy of the backups. Happy to answer questions!
document fetched 2026-10-27 00:37 · canonical https://reddit.com/r/homelab/comments/1xfvawf/rebuilt_my_media_server_from_scratch