
By the OpenFactory Team · February 10, 2026
A VPN encrypts traffic between a client and a gateway. It does not make the traffic disappear, make the endpoint trustworthy, or protect the path after packets leave that gateway. Self-hosting changes who operates the gateway; it does not remove the need for trust.
This post is about the exit: the public IP the rest of the internet sees when you browse, and who controls the box behind it. That is the job a commercial VPN sells you, and the one you can do better yourself. (If you instead want to dial into your home LAN to reach a NAS or a camera, the relevant pattern is a remote-access VPN, covered in our companion post on building a private home VPN. Same software, opposite direction of traffic.)
With a managed VPN, you depend on the provider's identity controls, gateway configuration, logging policy, infrastructure operators, and legal environment. With a self-hosted exit, you depend on your own configuration plus the hosting provider, upstream network, DNS choices, patch process, and incident response. In either model, HTTPS and other end-to-end protocols still matter because the VPN tunnel ends at the gateway.
NIST's remote-access guidance makes the same boundary explicit: a tunnel protects communications between the client and VPN gateway, not the traffic beyond the gateway or data on the client. Start with that model, then decide whether direct operational control is worth the added responsibility. Read NIST SP 800-46 Rev. 2.
A self-hosted gateway is a different trust arrangement, not a blanket privacy or security upgrade.
Evaluate the properties that matter to your threat model:
This prompt builds a full-tunnel WireGuard exit node. Unlike the split-tunnel road-warrior design, it deliberately routes client internet traffic through the gateway and enables outbound masquerading.
Build and validate a self-hosted WireGuard exit node named `private-exit` as a BUILD_PLAN.
Create one `device_kind=linux-build` node named `exit-gateway` on Debian Trixie with `headless`, `ssh`, and `vpn-wireguard`, plus iptables, tcpdump, iproute2, curl, and nftables. Give it `172.31.212.10/24` on a `wan` network with gateway `172.31.212.1` and `is_default_route=true`.
Set `plan.vpn` to protocol `wireguard`, implementation `linux`, mode `roadwarrior`, authentication `public-key`, tunnel CIDR `10.252.12.0/24`, listen port `51820`, and DNS servers `9.9.9.9` and `149.112.112.112`. The endpoint is `exit-gateway`, public endpoint `172.31.212.10`, and protected subnet `0.0.0.0/0`. Generate full-tunnel profiles named `laptop` and `phone` with `full_tunnel=true`. The generated gateway configuration must enable forwarding and outbound masquerading; never embed keys in the recipe.
Add a group scenario on `exit-gateway` that verifies `wg show wg0` reports UDP port `51820`, IPv4 forwarding is `1`, and the NAT POSTROUTING table contains a MASQUERADE rule. Keep all private keys in the owner-only deployment bundle.The prompt produces a reviewable build plan for a Debian gateway. A completed image is only the starting state: deploy private keys outside the recipe, replace the illustrative endpoint and addressing, configure the actual cloud or router forwarding path, and run the acceptance checks below before relying on the tunnel.
A self-hosted VPN can support several network patterns. Each needs its own routes, access policy, and failure tests:
The prompt above specifies WireGuard. IKEv2/IPsec through strongSwan is a separate design option, with a different policy, certificate, and client- interoperability surface:
StrongSwan IKEv2
WireGuard
Choose from client support, authentication requirements, policy model, network constraints, and the team's ability to operate the result. Running both expands the attack and maintenance surface; it is not a default requirement. strongSwan's security recommendations are a useful review boundary for an IKEv2 design.
Compare current provider or hosting prices at the time you decide. Include data transfer, snapshots, additional regions, monitoring, domain or address needs, replacement hardware, and operator time for updates and incidents.
A home gateway can reuse hardware but inherits the availability and upstream bandwidth of that site. A cloud gateway can offer a stable endpoint but adds a hosting provider, egress policy, and possible data-transfer charges to the trust and cost model.
Self-hosting may cost less or more. The defensible benefit is direct control over a defined configuration, not the absence of cost, logs, or trust.
Owning your exit is not strictly better at everything. One trade-off is that a dedicated IP is yours alone, so it doesn't blend you into a crowd the way a busy commercial exit does. You swap “hide in the herd” for a smaller, more attributable operating boundary. It also concentrates availability, configuration, and incident response in one place. A single self-hosted node is not an anonymity system and is not designed to resist a global observer.
Running the box means owning an ongoing maintenance and recovery checklist. Treat the build plan as draft intent and verify at least these controls yourself:
We have a pre-built Personal VPN Router recipe that expresses a StrongSwan IKEv2 and DNS-filtering starting point, or use the WireGuard plan above. Review the generated recipe and build record, then provision runtime credentials and validate it on compatible hardware or a VM. A bootable ISO is not evidence that routing, authentication, DNS, revocation, updates, or recovery works in your environment.
If you want the remote-access angle (reaching your own LAN rather than providing an exit), check out our companion post on building a private home VPN, which walks through StrongSwan IKEv2 step by step. Owning your exit also pairs naturally with taking back your data and browser isolation without the vendor lock-in. Those are three layers of the same idea: control the infrastructure your traffic runs on. For teams that need fleets of these appliances under one roof, see OpenFactory Enterprise and pricing.
Compare published self-service limits, or scope customer-controlled deployment and fleet requirements through a technical pilot.