VPN Access¶
Guide for setting up remote VPN access to your Omakase homelab.
Overview¶
VPN provides: - Secure remote access - Access services from anywhere - Encrypted tunnel - Protect traffic over public networks - Network-level access - Access all services as if on local network - Alternative to public exposure - Keep services private
VPN Options¶
WireGuard (Recommended)¶
Modern, lightweight VPN protocol:
Advantages: - Fast performance - Simple configuration - Built into Linux kernel - Low overhead - Strong cryptography
Use cases: - Personal devices (phone, laptop) - Always-on access - Road warrior setup
OpenVPN¶
Traditional VPN solution:
Advantages: - Widely supported - Works through most firewalls - TCP/UDP modes - Extensive features
Use cases: - Legacy device support - Complex network scenarios - Site-to-site VPN
Tailscale (Easiest)¶
Mesh VPN built on WireGuard:
Advantages: - Zero configuration - Automatic key management - Works behind NAT - Cross-platform apps - Free tier available
Use cases: - Quick setup - Multiple devices - Non-technical users
WireGuard Setup¶
Server Installation¶
- Add WireGuard to compose (not included by default):
Create compose/wireguard/compose.yaml:
services:
wireguard:
image: linuxserver/wireguard:latest
container_name: wireguard
cap_add:
- NET_ADMIN
- SYS_MODULE
environment:
PUID: ${PUID}
PGID: ${PGID}
TZ: ${TZ}
SERVERURL: ${WIREGUARD_SERVER_URL}
SERVERPORT: 51820
PEERS: 5 # Number of clients
PEERDNS: auto
INTERNAL_SUBNET: 10.13.13.0/24
volumes:
- ${DATA_DIR}/wireguard/config:/config
- /lib/modules:/lib/modules:ro
ports:
- 51820:51820/udp
sysctls:
- net.ipv4.conf.all.src_valid_mark=1
restart: unless-stopped
security_opt:
- no-new-privileges:true
- Configure environment:
Add to Infisical:
-
Deploy WireGuard:
-
Generate client configs:
QR codes and config files in ${DATA_DIR}/wireguard/config/peer*/
Client Configuration¶
Mobile (iOS/Android): 1. Install WireGuard app 2. Scan QR code from logs 3. Connect
Desktop (Linux/macOS/Windows):
1. Install WireGuard client
2. Import config file: peer1/peer1.conf
3. Activate connection
Config file format:
[Interface]
PrivateKey = <client-private-key>
Address = 10.13.13.2/32
DNS = 10.13.13.1
[Peer]
PublicKey = <server-public-key>
Endpoint = vpn.yourdomain.com:51820
AllowedIPs = 192.168.0.0/16 # Access homelab network
PersistentKeepalive = 25
Firewall Configuration¶
Open UDP port 51820:
Tailscale Setup (Easiest Option)¶
Installation¶
-
Sign up: https://tailscale.com
-
Install on server:
-
Install on clients: Download apps from https://tailscale.com/download
-
Access services: Use Tailscale IPs or MagicDNS names
Docker Integration¶
Run Tailscale as sidecar:
services:
tailscale:
image: tailscale/tailscale:latest
container_name: tailscale
hostname: omakase
environment:
TS_AUTHKEY: ${TAILSCALE_AUTH_KEY}
TS_STATE_DIR: /var/lib/tailscale
volumes:
- ${DATA_DIR}/tailscale:/var/lib/tailscale
- /dev/net/tun:/dev/net/tun
cap_add:
- NET_ADMIN
- SYS_MODULE
restart: unless-stopped
Advantages¶
- Zero port forwarding - Works behind NAT
- Automatic encryption - No manual key management
- MagicDNS - Access services by name
- Access controls - Manage in web UI
- Exit nodes - Route traffic through homelab
Network Configuration¶
Split Tunnel¶
Only route homelab traffic through VPN:
WireGuard:
Advantages: - Faster internet speed - Lower latency - Less server load
Full Tunnel¶
Route all traffic through VPN:
WireGuard:
Use cases: - Public WiFi security - Hide browsing from ISP - Access geo-restricted content
DNS Configuration¶
Local DNS Resolution¶
Access services by name:
Option 1: Hosts file on client:
Option 2: Internal DNS server (Pi-hole, AdGuard): Configure VPN DNS to point to internal DNS server.
MagicDNS (Tailscale)¶
Enable in Tailscale admin:
- Access services: http://omakase:8080
- No manual DNS configuration needed
Security Best Practices¶
- Strong keys - Use generated WireGuard keys, never create manually
- Limited peer count - Only create necessary clients
- Regular rotation - Rotate keys periodically
- Revoke unused peers - Remove old devices
- Monitor connections - Check who's connected
- Firewall rules - Limit VPN network access if needed
- 2FA where possible - Use Tailscale's SSO with 2FA
Monitoring¶
WireGuard Status¶
# Check peers
docker exec wireguard wg show
# View logs
docker compose logs wireguard
# Connection status
docker exec wireguard wg show wg0
Tailscale Status¶
# Connection status
sudo tailscale status
# Network map
sudo tailscale netcheck
# Peer list
sudo tailscale status --json
Troubleshooting¶
Can't Connect¶
Check server running:
Check firewall:
Check port forwarding on router (if behind NAT).
Verify endpoint:
Connected But Can't Access Services¶
Check routing:
Check AllowedIPs: Ensure client config includes homelab subnet:
Check server IP forwarding:
Enable if needed:
Slow Performance¶
Check MTU:
Reduce keepalive:
Use split tunnel instead of full tunnel.
Access Patterns¶
Mobile Access¶
Setup for accessing homelab from phone:
- Install WireGuard mobile app
- Scan QR code or import config
- Toggle connection when needed
- Access services at
https://service.yourdomain.com
Laptop Road Warrior¶
Always-on VPN for remote work:
- Install WireGuard desktop client
- Import config
- Set to auto-connect
- Work as if on local network
Site-to-Site¶
Connect two locations:
- Setup WireGuard on both sites
- Configure as peers
- Route networks between sites
- Access resources on both networks
Alternative: SSH Tunnel¶
For quick, one-off access without VPN:
# Forward port through SSH
ssh -L 8080:localhost:8080 user@homelab-server
# Access at http://localhost:8080
SOCKS proxy:
# Create SOCKS proxy
ssh -D 9999 user@homelab-server
# Configure browser to use localhost:9999 as SOCKS proxy
Public Access Considerations¶
When to Use VPN¶
- ✅ Want to keep services private
- ✅ Don't want to expose ports publicly
- ✅ Need access from trusted devices only
- ✅ Want encrypted access over public WiFi
When to Use Public Access¶
- ✅ Need to share with others
- ✅ Access from many devices
- ✅ Don't want VPN complexity
- ✅ Use Authelia + CrowdSec protection
Hybrid approach: VPN for admin services, public for user-facing.
See Also¶
- Network Architecture - Network design
- Security Best Practices - Security guidelines
- Traefik - Reverse proxy setup