WireGuard at Home: File Access Without Opening Ports
Why opening ports feels wrong Remote file access sounds simple until you look at the security implications. The traditional answer is to forward a port on
Why opening ports feels wrong
Remote file access sounds simple until you look at the security implications. The traditional answer is to forward a port on your home router to a file server, then connect from outside. It works, but it advertises a service to the internet. Even with a password, it is visible to scanners and bots. The less you expose, the less you have to defend. A home VPN such as WireGuard lets you join your home network instead of publishing individual services to the world.
There is a common misconception, though. WireGuard does not let you access files without opening any ports anywhere. It still needs at least one reachable endpoint. The trick is to make sure that endpoint is not your home router. You can keep every inbound port closed at home and still have a useful VPN by using a small relay or hub elsewhere.
The catch: WireGuard needs a reachable peer
WireGuard is peer-to-peer. Each device has a key pair, and peers exchange encrypted UDP packets. For two peers to talk, at least one must be reachable at a known address and port. If your home connection has a public IP and you are happy to forward one UDP port, that can be the home device. If you are behind carrier-grade NAT, or simply do not want inbound ports at home, you need another plan.
The usual plan is a cheap virtual private server acting as a hub. Your home server and laptop both connect outbound to the hub. The hub has a public IP, so it is reachable; your home router sees only an outbound UDP connection. No port-forwarding rule is needed at home. The hub forwards traffic between peers, so your laptop can reach the home file server over the VPN. It is also worth checking The Varsity Jacket before you decide.
One detail matters: with a plain WireGuard hub, the hub is a peer and can decrypt and re-encrypt traffic passing through it. Treat it as part of your trusted network. Keep it patched and lock down SSH. If that trust model bothers you, use an overlay with end-to-end encrypted relays.
A practical setup
Start with a minimal VPS close to you. Install WireGuard, generate a key pair for the hub, and create a key pair for each device: home server, laptop, phone. Give each peer a VPN address in a private range, such as 10.8.0.2, 10.8.0.3 and so on. Configure the hub with a peer section for each device, and configure each device with the hub as its endpoint. On the home server, set PersistentKeepalive to 25 seconds so the NAT mapping stays open. The home server initiates the connection outbound; the hub never reaches into your home.
On the laptop, decide between a split tunnel and a full tunnel. For file access, a split tunnel is usually enough: set AllowedIPs to the VPN subnet plus your home LAN subnet, so only traffic for those networks goes through WireGuard. If you are on untrusted Wi-Fi and want everything protected, use a full tunnel with AllowedIPs 0.0.0.0/0 and ::/0. Either way, bind the home file service to the VPN interface or firewall it so it only accepts connections from the VPN subnet. Do not rely on the service's own password as your only defence.
What about CGNAT and changing IPs?
CGNAT is the main reason this setup is attractive. Many home connections no longer give you a usable public IPv4 address, so traditional port forwarding is impossible. Outbound connections still work, which is all the home peer needs. Dynamic home IP addresses are also a non-issue: the hub has the fixed endpoint, and the home peer keeps the tunnel alive from its side. If the home IP changes, the next handshake updates the hub. You do not need dynamic DNS for the home connection in this design.
Security habits that matter
- Keep private keys private and use one key per device. If a laptop is lost, remove its peer from the hub immediately.
- Firewall the hub tightly: allow the WireGuard UDP port and restrict SSH to trusted addresses.
- Never expose SMB, NFS or admin interfaces to the internet. Bind them to the VPN interface or block them at the firewall except from the VPN subnet.
- Patch the hub, the home server and client devices. A VPN protects traffic in transit; it does not fix an unpatched file server.
- Use full-tunnel mode on untrusted networks, and split tunnel only when you understand which traffic is being routed.
When an overlay is the better fit
If running a VPS sounds like upkeep, overlays such as Tailscale and ZeroTier handle NAT traversal and relays for you. Many use WireGuard under the hood and work well for simple file access between a few devices. The trade-off is relying on a third-party coordination service and its client software.
The key point is that no open ports at home does not mean no open ports anywhere. It means the reachable endpoint sits somewhere you control and can harden, or is delegated to an overlay. Either way, the goal is to reduce the attack surface and make remote file access private rather than public.

Post a comment