Your homelab is humming along nicely. Proxmox is virtualizing, containers are spinning, and your Grafana dashboards look great. But it’s an island, completely inaccessible once you leave your house. You want to access your files, check on your services, or SSH into a box from anywhere in the world.
This isn’t about just punching holes in your firewall. It’s about building a secure and reliable bridge to your home network. We’ll cover the fundamental piece of the puzzle: getting a stable public address for your lab and then using it to build a secure access layer.
The Public IP Problem: Static vs. Dynamic
Your Internet Service Provider (ISP) assigns your router a public IP address. This is your home’s address on the internet. For most residential customers, this address is dynamic, meaning it can and will change without warning. That’s a huge problem for self-hosting. If your address changes, your domain name will point to a dead end.
You have two paths forward.
Scenario 1: Pay for a Static IP
The simplest solution is to call your ISP and ask for a business plan or a static IP add-on.
- Pros: It’s rock solid. Your IP address is fixed, so DNS is a one-time setup. Point your
Arecord at the IP and you’re done. Forever. - Cons: It costs money, typically an extra $10-20 per month. Some residential ISPs flat-out refuse or have terms of service that forbid running servers. Read the fine print.
If you can get one and don’t mind the cost, do it. It eliminates an entire category of problems.
Scenario 2: Tame Your Dynamic IP with DDNS
Most of us are stuck with a dynamic IP. The solution is Dynamic DNS (DDNS). A small client running on your network constantly checks your public IP. When it detects a change, it automatically updates your DNS record to point to the new address.
It sounds complex, but it’s a solved problem. Services like DuckDNS (free) or your domain registrar’s own tools can handle this. I prefer using Cloudflare to manage my DNS, since its API is fantastic and well-supported.
You can run a DDNS client in a simple Docker container. Here’s a docker-compose.yml for the popular cloudflare-ddns client. It’s lightweight and reliable.
# docker-compose.yml
version: "3.8"
services:
cloudflare-ddns:
image: oznu/cloudflare-ddns:latest
container_name: cloudflare-ddns
restart: always
environment:
# Required: Create an API Token with Zone:DNS:Edit permissions
- API_TOKEN=YOUR_CLOUDFLARE_API_TOKEN
# Required: Your root domain
- ZONE=yourdomain.com
# Optional: Comma-separated list of subdomains to update
# Use '@' for the root domain
- SUBDOMAINS=homelab,nas,vpn
# Optional: Set to true to proxy through Cloudflare
- PROXIED=false
Set PROXIED=false for services that aren’t HTTP/S, like a VPN endpoint. With this running, vpn.yourdomain.com will always point to your home, no matter how often your ISP changes your IP.
Port Forwarding: The Old, Dangerous Way
With a stable address, the rookie mistake is to start port forwarding everything. You want SSH access? Forward port 22 to your server. Want to see your Proxmox UI? Forward port 8006.
Don’t do this.
Exposing management interfaces directly to the internet is practically an invitation for attack. Automated bots are scanning the entire internet for open ports 24/7. Your logs will fill up with failed login attempts from all over the world. This is how you get your NAS encrypted by ransomware. Only forward ports for services you explicitly intend to be public, and even then, they should sit behind a battle-hardened reverse proxy.
The Right Way: Secure Remote Access
Instead of opening a dozen ports, you open just one. This single port will be the entry point for your private VPN. Once connected to the VPN, your remote device (laptop, phone) is effectively on your local network. You can access every service by its internal IP address (192.168.1.50:8006) just as if you were sitting on your couch. Nothing else is exposed.
Option 1: WireGuard (The DIY Standard)
WireGuard is a modern VPN protocol that is lean, fast, and built into the Linux kernel. It’s the de facto standard for self-hosted VPNs.
- How it works: You run a WireGuard server on a device in your homelab (a Raspberry Pi, a VM, or even a container). You forward a single UDP port (e.g., 51820) from your router to this server. Your clients (phone, laptop) have a configuration file with keys that lets them connect.
- Pros: Incredible performance and low overhead. You control all the keys and infrastructure. It’s the most secure and performant option if you’re willing to do the setup.
- Cons: Configuration is manual. You have to generate keys and distribute config files to each device. Tools like
wg-easyprovide a web UI to simplify this process immensely, so the “con” is pretty small. Your DDNS setup is critical here; the hostname (vpn.yourdomain.com) goes directly into the client config files.
Option 2: Tailscale (The “It Just Works” Overlay Network)
Tailscale is built on top of WireGuard but takes a different approach. It’s an overlay network. You install the Tailscale client on all your devices, log in with a Google or Microsoft account, and they instantly form a private, encrypted mesh network.
- How it works: Tailscale uses a central coordination server to manage authentication and key exchange. It then uses clever NAT traversal techniques to establish direct, peer-to-peer WireGuard connections between your devices. No port forwarding is required.
- Pros: Absurdly easy to set up. It Just Works™, even through restrictive firewalls or frustrating CGNAT scenarios where port forwarding is impossible.
- Cons: You’re depending on a third-party’s control plane. If Tailscale’s servers go down, you can’t establish new connections or add new devices (existing connections usually stay up). The free tier is generous for personal use, but it is a commercial service.
What About L2TP/IPsec?
You might see older guides, like the one from vimuser.org, that mention protocols like L2TP/IPsec. These were standard for enterprise VPNs for years. They work. But setting them up is a nightmare of arcane config files and fragile firewall rules. WireGuard offers superior performance with a fraction of the complexity. Unless you have a legacy device that only supports L2TP, there is no good reason to choose it in 2026.
A Pragmatic Recommendation
For most homelabbers, this is the winning combination:
- Use a DDNS client in a Docker container to keep a DNS record pointed at your home.
- Set up a WireGuard server on a reliable, low-power machine.
wg-easyis a great way to get started with a web UI. - Forward one single UDP port from your router to the WireGuard server.
- Install the WireGuard client on your devices and point them to your DDNS hostname.
This setup gives you full control, top-tier performance, and a tiny attack surface. You get all the benefits of remote access without exposing your entire lab to the internet’s dark corners.
What’s Next
Once you have secure remote access, you can start building out more complex services. Here are a few places to go from here:
[discussion]
Comments are powered by Giscus — backed by GitHub Discussions. Sign in with GitHub to join the conversation.