Your Network Is the Foundation

Every self-hosted app, remote backup, and media stream depends on predictable local networking. Clean DNS, tidy subnetting, and deliberate firewall rules prevent brittle workarounds later.
DNS: Where Local Control Begins
Every phone, laptop, and smart TV resolves hostnames through DNS. Running a local resolver cuts ad and tracker traffic network-wide while giving internal hostnames clean local routing.
Pi-hole: Network-Wide DNS Filtering
Pi-hole acts as a local DNS sinkhole, blocking known advertising and telemetry domains across devices that cannot run browser extensions.
Basic setup:
- Run Pi-hole in Docker or on a Raspberry Pi with a static LAN IP.
- Point your router's DHCP DNS option to that IP.
- Verify queries appear in the dashboard (typically blocking 15–30% of tracker requests).
AdGuard Home: Encrypted Upstream Built In
AdGuard Home covers the same filtering role with built-in DNS-over-HTTPS (DoH) and DNS-over-TLS (DoT) plus per-client filter toggles.
| Feature | Pi-hole | AdGuard Home |
|---|---|---|
| Ad blocking | Mature blocklists | Mature blocklists |
| Web UI | Functional | Modern layout |
| Encrypted upstream DNS | Via Unbound or Cloudflared | Built-in DoH/DoT |
| Per-client controls | Group rules | Per-device switches |
| RAM usage | Very low | Low |
Reverse Proxies: Clean HTTPS Routing
A reverse proxy listens on ports 80 and 443, terminates TLS certificates, and forwards each subdomain to its internal backend port.
Caddy: Automatic HTTPS
Caddy requests and renews Let's Encrypt certificates automatically with concise configuration:
# Caddyfile
nextcloud.yourdomain.com {
reverse_proxy 192.0.2.10:8080
}
vaultwarden.yourdomain.com {
reverse_proxy 192.0.2.10:8081
}
jellyfin.yourdomain.com {
reverse_proxy 192.0.2.10:8096
}Traefik: Docker-Native Labels
Traefik watches the Docker socket and reads routing rules straight from container labels:
# docker-compose.yml labels
labels:
- "traefik.enable=true"
- "traefik.http.routers.nextcloud.rule=Host(`nextcloud.yourdomain.com`)"
- "traefik.http.routers.nextcloud.tls.certresolver=letsencrypt"Nginx Proxy Manager: Browser Interface
For administrators who prefer managing proxy hosts and certificates through a web dashboard, Nginx Proxy Manager wraps Nginx and Certbot in a clean UI.
VLANs: Network Segmentation
Virtual LANs split trusted workstations, servers, smart-home gadgets, and guest Wi-Fi onto separate logical subnets over shared switches:
| VLAN | Purpose | Example Devices |
|---|---|---|
| VLAN 1 | Management | Router, managed switches, access points |
| VLAN 10 | Trusted | Laptops, desktops, phones |
| VLAN 20 | Servers | NAS, Docker hosts |
| VLAN 30 | IoT | Smart plugs, cameras, thermostats |
| VLAN 40 | Guest | Visitor Wi-Fi |
Isolating IoT devices keeps a compromised smart camera or plug from probing your NAS or SSH ports.
Equipment required: An entry-level managed Gigabit switch (such as an 8-port TP-Link TL-SG108E) paired with a VLAN-capable router running OPNsense, pfSense, or OpenWrt.
VPN: Private Remote Access
WireGuard
WireGuard uses modern cryptography inside the Linux kernel for fast handshakes and low battery drain on phones. Use it to reach home NAS shares, SSH consoles, and admin panels remotely without exposing them on the public web.
Tailscale and Headscale
Tailscale automates WireGuard key exchange and NAT traversal across devices with zero router port forwarding. Headscale lets you self-host the coordination server if you prefer full independence.
Firewalls
| Firewall | Type | Best For | Cost |
|---|---|---|---|
| OPNsense | Dedicated router/firewall OS | Mini PC router builds | Free (open source) |
| pfSense | Dedicated router/firewall OS | Dedicated firewall hardware | Free (CE) |
| OpenWrt | Embedded router firmware | Supported consumer routers | Free (open source) |
| UFW | Linux host firewall | Individual Docker/Linux servers | Free (built-in) |
| nftables / iptables | Low-level Linux packet filter | Custom host rules | Free (kernel) |
Baseline UFW Rules
# Default deny incoming, allow outgoing
sudo ufw default deny incoming
sudo ufw default allow outgoing
# Allow SSH (change port if needed)
sudo ufw allow 22/tcp
# Allow HTTP/HTTPS for reverse proxy
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
# Allow WireGuard
sudo ufw allow 51820/udp
# Enable
sudo ufw enableCloudflare Tunnel: Zero Open Router Ports
Cloudflare Tunnel runs a lightweight daemon inside your network that dials outbound to Cloudflare, publishing chosen web apps without opening inbound firewall ports or exposing your home IP. Note that TLS terminates at Cloudflare's edge; use WireGuard or Tailscale whenever end-to-end privacy matters most.
Network Hardware Tiers
| Category | Entry Pick | Mid-Range | Enthusiast |
|---|---|---|---|
| Router | OpenWrt on existing router | Mini PC + OPNsense | Protectli VP2420 |
| Switch | TP-Link TL-SG108E (managed) | TP-Link TL-SG3210 (L2+ managed) | UniFi PoE managed switch |
| Access Point | TP-Link EAP225 | UniFi U6 Lite | UniFi U6 Pro |
| Cabling | Cat5e (up to 1GbE) | Cat6 (up to 10GbE short runs) | Cat6a (10GbE up to 100m) |
Consistent Naming
- Devices:
type-location-number(nas-office-01,ap-lounge-01). - VLANs and subnets: Match numbers cleanly (VLAN 10 →
10.0.10.0/24). - Network diagram: Keep an up-to-date map in draw.io alongside
/docs/notes.
Product links may include affiliate partnerships. See our affiliate disclosure for details.