Skip to main content
← All Projects // DEVOPS & HOMELAB

Self-Hosted Infrastructure

Two Machines. Thirty Services. Zero SaaS.

A full homelab stack across two machines — RPi5 running core networking and lightweight apps, Lenovo Flex 4 running automation and data tools — all routed through Traefik with Authelia SSO.

Self-Hosted Docker Traefik Homelab DevOps Infrastructure
// ARCHITECTURE

System Architecture

Hover over any service chip to see what it does. Two physical machines, one unified infrastructure — all traffic routed through a single Traefik entry point.

🌐 Internet
☁️ Cloudflare DDNS + Tunnel
REVERSE PROXY
Traefik
🏷 Docker Labels 📄 External Service File
RPi5
Raspberry Pi 5
16 GB RAM · ARM64
Networking & Security
Traefik
Authelia
Socket-proxy
CF DDNS
Infrastructure
Sablier
Promtail
Hawser
Apps & Productivity
Grist
Vikunja
Karakeep
Marreta
Postiz
IT-Tools
Dozzle
Flex 4
Lenovo Flex 4
Repurposed · x86_64
Automation & Integration
n8n
Windmill
Activepieces
Dev & Secrets
VScode
Infisical
DocuSeal
Data & Analytics
Grafana
Prometheus
cAdvisor
Metabase
Evidence
Operations & Content
Duplicati
Dockhand
Paperless-ngx
Ghostfolio
Outline
Blinko
Twenty
Invoice Ninja
Mautic
// HOW IT WORKS

Request Lifecycle

Every request — from any device, anywhere — follows this exact path before reaching a service. No exceptions. No back doors.

Browser
DNS LOOKUP
resolves
Cloudflare
DDNS + EDGE
:443
Traefik
TLS TERMINATION
forward-auth
Authelia
SESSION CHECK
200 OK
Service
DESTINATION
No valid session? Authelia returns 401 — Traefik serves the login page. The target service never receives the request.
// IMPACT

By the Numbers

30+ SERVICES RUNNING Across 2 physical machines
$0 MONTHLY SAAS FEES All tools owned and operated
1 LOGIN FOR EVERYTHING Authelia SSO + MFA enforced
<1s COLD START TIME Sablier wakes idle containers
// COST ANALYSIS

What This Would Cost in SaaS

Every service below runs locally on hardware I already own. The "SaaS equivalent" column shows what a comparable hosted product bills monthly.

Self-Hosted Service SaaS Alternative Monthly SaaS Cost Savings
n8n Workflow automation n8n Cloud Starter $20 $20
Outline Team wiki / knowledge base Notion Team $10 $10
Invoice Ninja Invoicing & billing Invoice Ninja Pro $14 $14
Ghostfolio Portfolio tracker Ghostfolio Premium $14 $14
DocuSeal Document signing HelloSign Essentials $15 $15
Mautic Email & marketing Mailchimp Essentials $20 $20
Infisical Secrets management Infisical Pro $6 $6
Grafana + Loki Observability stack Grafana Cloud Pro $29 $29
Total monthly SaaS equivalent $128/mo $0/mo

Hardware cost: RPi5 (~$80 one-time) + repurposed Lenovo Flex 4 ($0). Electricity: ~$8/mo for both. ROI < 8 months.

// DESIGN

Key Design Decisions

Split Routing

Traefik runs only on the RPi5. RPi5 services use Docker labels for zero-config routing. Flex 4 services are defined in a static external service file — no Traefik container on the Flex 4 itself, keeping it lean.

Single Sign-On

Authelia acts as a forward-auth middleware for all services. One login with MFA covers every app — no per-service passwords, no credential sprawl.

Resource Efficiency

Sablier auto-stops idle containers and wakes them on demand. Rarely-used services don't waste RAM when inactive — sub-second wake-on-request.

Docker Socket Isolation

The Docker socket is never directly exposed to containers. A socket-proxy enforces an allowlist of safe API calls — Traefik manages routing without full Docker access.

Centralized Observability

Promtail ships logs from the RPi5 to the Flex 4 Grafana/Loki stack. All metrics and logs in one dashboard, regardless of which machine generated them.

AI-Assisted Operations

Paperless-AI automatically tags and categorizes incoming documents. n8n orchestrates cross-service workflows — reducing manual overhead for routine ops tasks.

// PHILOSOPHY

Why Self-Host?

Every SaaS subscription is a dependency. A pricing change, a policy update, a data breach — any of it can break a workflow you depend on. Self-hosting trades convenience for control, and for a data-driven person who cares about where their data lives, that tradeoff is worth it.

Owning your stack isn't about saving money. It's about knowing exactly what's running and why.

The architecture evolved from a single Raspberry Pi running a handful of services into a split two-node setup as the workloads grew. The RPi5 handles latency-sensitive networking; the Flex 4 handles CPU-intensive data and automation tasks.

The most important lesson: start with a good reverse proxy and auth layer. Everything else can be added incrementally, but retrofitting SSO and TLS across 20 services is painful. Build the entry point first, then add services behind it.

// STACK

Core Infrastructure

Traefik v3 Reverse Proxy + TLS
RPi5
Authelia SSO + MFA
RPi5
Docker Compose Container Orchestration
RPi5 + Flex 4
Grafana + Loki Observability Stack
Flex 4
Sablier Container Sleep + Wake
RPi5
Raspberry Pi 5 16 GB · ARM64 · Edge Node
hardware