What does a VPN actually do?
It takes packets that would normally travel in the open, encrypts them, adds a new outer header addressed to the other end of the tunnel, and sends them across the internet. The far end strips the wrapper, checks that nothing was altered, and forwards the original packet as though it had arrived on a local cable. Anyone in between, from a hotel network to a transit provider, sees only encrypted UDP or ESP traffic between two addresses. The word virtual matters: there is no private wire, just cryptography that makes a shared network behave like one.
Which kinds of VPN are common?
| Type | Endpoints | Typical use |
|---|---|---|
| Remote access | A laptop or phone and a gateway | Staff reaching internal tools, admins reaching servers |
| Site to site | Two routers or servers | Joining an office network to machines in a data center |
| Mesh | Every node to every other node | Clusters spread over several cities or providers |
| Consumer privacy VPN | A user and a shared exit server | Changing the apparent source address of browsing |
Which protocols should I know?
- WireGuard: a small kernel module with modern fixed cryptography, configured with key pairs and a few lines of text. Fast, easy to audit, and built into every current Linux kernel.
- IPsec (IKEv2): the long-standing standard spoken by routers and built into most phones and desktop systems without extra apps. More moving parts, wide compatibility.
- OpenVPN: runs in user space over TLS on UDP or TCP. Slower per core than WireGuard but flexible, and it can pass through restrictive networks on TCP 443.
- SSH tunnels: not a VPN in the strict sense, yet
ssh -Landssh -Dcover many one-off admin needs. How SSH works explains the channel model.
Why run a VPN on a dedicated machine?
A server you control becomes a stable, trusted entry point. You can keep databases, dashboards and SSH bound to the tunnel interface only, so the public internet sees nothing but one UDP port. Because our machines have no private network between them, a tunnel is also the normal way to link two boxes in different cities, for example a primary in Ashburn and a replica in Amsterdam. The VPN gateways page sizes machines for many concurrent users.
How do I stand up a small WireGuard endpoint?
apt install -y wireguard (umask 077 && wg genkey > /etc/wireguard/gw.key) wg pubkey < /etc/wireguard/gw.key > /etc/wireguard/gw.pub cat > /etc/wireguard/wg0.conf <<'EOF' [Interface] Address = 10.44.0.1/24 ListenPort = 51820 PrivateKey = (contents of gw.key) [Peer] # laptop of the operations lead PublicKey = (the base64 key printed by wg pubkey on the laptop) AllowedIPs = 10.44.0.12/32 EOF systemctl enable --now wg-quick@wg0.service; wg show wg0 latest-handshakes
Open UDP 51820 in the host firewall, and if clients should reach the internet through the server, enable forwarding with sysctl -w net.ipv4.ip_forward=1 and add a masquerade rule. A handshake time that updates every two minutes or so means the peer is alive.
How big a machine does a tunnel endpoint need?
Less than people expect. WireGuard encrypts at several gigabits per second per modern core, so a four-core box handles a team easily. The limit for a busy exit node is more often the monthly outgoing traffic than CPU: every byte a client downloads through the tunnel leaves the server again. The E1 (Intel Xeon E3-1240 v3, 2x 1 Gbps) is plenty for an admin gateway, while the S1 with 2x 10 Gbps ports suits a large office or a mesh hub.
How do I keep admin services reachable only through the tunnel?
Bind them to the tunnel address rather than to every interface. For SSH, add ListenAddress 10.44.0.1 to a drop-in file under /etc/ssh/sshd_config.d/ once you have confirmed the tunnel comes up at boot, and keep a panel reboot in mind as the recovery path if you lock yourself out. Databases such as PostgreSQL take the same idea through listen_addresses. The host firewall should then accept UDP 51820 from anywhere and nothing else from the public side except the services you really publish, such as HTTPS. This one change removes the vast majority of login attempts that show up in logs on any machine with a public address.
What does a VPN not do?
It protects data in transit between the endpoints and nothing more. Traffic leaving the exit server toward a website is ordinary internet traffic again, a compromised laptop stays compromised inside the tunnel, and weak passwords on internal services remain weak. Pair the tunnel with key-based SSH, per-service accounts and a default-deny firewall; ZTNA describes the identity-first model that grew out of these limits.
Low-Cost Machines for a VPN Gateway
| Server | Processor | Cores / threads | Memory | Storage | Network | Per month | Smallest order |
|---|---|---|---|---|---|---|---|
| E1 | Intel Xeon E3-1240 v3 | 4 / 8 | 16 GB DDR3 | 2x 240 GB SSD | 2x 1 Gbps | $30.52 | $91.56 (3 months) |
| E2 | Intel Xeon E3-1270 v3 | 4 / 8 | 32 GB DDR3 | 1x 480 GB SSD | 2x 1 Gbps | $38.32 | $114.96 (3 months) |
| S1 | Intel Xeon E-2276G | 6 / 12 | 64 GB DDR4 | 1x 1 TB NVMe | 2x 10 Gbps | $53.32 | $53.32 (1 month) |
| S2 | Intel Xeon E-2356G | 6 / 12 | 64 GB DDR4 | 1x 1 TB NVMe | 2x 10 Gbps | $58.39 | $58.39 (1 month) |
Keep Reading
VPN gateways
Run WireGuard or OpenVPN for a team or a fleet of offices on a box whose CPU and port belong to you alone.
OpenVPN server
A server that accepts encrypted tunnels from devices or sites and joins them to a network, with WireGuard and OpenVPN compared.
OpenHow SSH works
Follow one SSH connection from the TCP handshake through key exchange, host verification and login to channels and forwarding.
OpenZTNA
Access to individual applications granted per user and per request instead of a whole network, how it differs from a VPN, and a self-hosted path.
OpenFAQ
Quick Answers
WireGuard is simpler to set up and faster per core. OpenVPN is the fallback when you need TCP transport or older client support.
Yes, with a tunnel such as WireGuard between their public addresses. There is no separate private network, so the tunnel provides the private path.
Slightly. Encryption adds a little CPU work and the outer header reduces the usable packet size, but on modern hardware the difference is small.
Any UDP port you choose. 51820 is the conventional default, and it must be open in the server firewall.
Yes. Data that leaves the server toward clients or the internet counts as outgoing traffic like any other.