Skip to content

Instantly share code, notes, and snippets.

@afrexai-cto
Created February 26, 2026 00:31
Show Gist options
  • Select an option

  • Save afrexai-cto/fc341f8f943690bd67b8935cdf65c73b to your computer and use it in GitHub Desktop.

Select an option

Save afrexai-cto/fc341f8f943690bd67b8935cdf65c73b to your computer and use it in GitHub Desktop.
Self-Hosting Guide 2026: Complete Homelab Setup with Docker, Traefik, Backups & Monitoring

Self-Hosting Guide 2026: Complete Homelab Setup

Everything you need to build a reliable self-hosted infrastructure — from first server to multi-node homelab.

Why Self-Host?

  • Privacy: Your data stays on your hardware
  • Cost: Many services cost $0 after initial hardware
  • Control: No vendor lock-in, no price hikes, no shutdowns
  • Learning: Best way to understand infrastructure

Essential Services Stack

Deploy First (Foundation)

Service Purpose RAM
Traefik/Caddy Reverse proxy + SSL 64MB
Pi-hole/AdGuard DNS + ad blocking 128MB
Authelia SSO + 2FA 128MB
Uptime Kuma Monitoring 128MB

Core Services

Service Purpose RAM
Vaultwarden Password manager 64MB
Nextcloud File sync 512MB
Immich Photo backup 1-4GB
Jellyfin Media server 512MB-2GB
Paperless-ngx Document management 256MB

Docker Compose Best Practices

services:
  app:
    image: vendor/app:1.2.3       # ALWAYS pin version
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    deploy:
      resources:
        limits:
          memory: 512M

Security Checklist

  • Change SSH port, disable root, key-only auth
  • Enable UFW with deny-by-default
  • All services behind reverse proxy
  • SSL/TLS on everything
  • SSO + 2FA via Authelia/Authentik
  • Container security: non-root, memory limits, no-new-privileges
  • Secrets in .env files, never in compose

Backup: 3-2-1 Rule

  • 3 copies of data
  • 2 different media types
  • 1 offsite copy

RAID is NOT backup. It protects against disk failure, not ransomware/deletion/corruption.

Hardware Decision Matrix

Budget RAM Good For
$0 4-8GB Pi-hole, small tools (Raspberry Pi)
$50-150 8-16GB Docker host, 5-10 services (Used SFF PC)
$150-400 16-32GB NAS + services (Mini PC)
$400-800 32-64GB Full homelab (Used enterprise)

Want the Full System?

Get the complete 30KB self-hosting methodology with Docker templates, Traefik configs, backup scripts, monitoring setup, and security scoring:

clawhub install afrexai-self-hosting-mastery

More agent skills: AfrexAI on ClawHub

Full context packs for your business: AfrexAI Store

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment