Your own VPN at home or on a VPS: is it worth setting up?

Home VPN: What Equipment You Need and How to Secure Access

A home virtual private network (VPN) lets you connect to your home network while you are away from home, through an encrypted tunnel.

For a server, an inexpensive single-board computer or an x86_64 computer with a supported operating system will suffice. Security comes from updates, separate keys and access restrictions. I recommend an Ethernet cable, a fixed local address and a single open port for WireGuard — the protocol that creates the tunnel.

Choose a Device with a Supported System

Start with the equipment you already have. A network-attached storage (NAS) that provides access to your home files will also do.

DeviceWhat you needPlusLimitation
Raspberry PiSupported system, power, EthernetA dedicated VPN nodeThe system needs maintaining
Mini PC or old x86_64 PCFor example, a supported Ubuntu ServerYou can use a PC you already ownIt must stay switched on
NASWireGuard server supportIt is already running at homeCompatibility depends on the system
RouterFirmware with a VPN serverNo second device neededA VPN client feature is not enough

PiVPN is an installer that sets up WireGuard or OpenVPN. Its documentation lists Raspberry Pi 1–5 and Zero, single-board computers with DietPi and x86_64 servers. Systems: Raspberry Pi OS Bullseye/Bookworm, Ubuntu Server 20.04/22.04/24.04, DietPi and Alpine. This is installer compatibility — check the system's support period as well. PiVPN is maintained on a best-effort basis by its developers.

For a Raspberry Pi 5, plan for a 5 V/5 A USB-C power supply and active cooling. For guidance on choosing, see the comparison of running your own VPN server and using a ready-made service.

Choose a Device with a Supported SystemEnlarge image
Choose a Device with a Supported System
SimonWaldherr (Wikimedia Commons) · Raspberry Pi 5 with active cooler — 11 January 2024 · CC BY 4.0

Reserve a Fixed Address and Open Only the Necessary Port

Connect the server by cable. On the router, set up a reservation in the dynamic host configuration protocol (DHCP): it reserves a fixed local address for the device's network interface. Thanks to the reserved address, the port forward will point to the right device.

Forward exactly one user datagram protocol (UDP) port to the WireGuard server: it carries the tunnel's packets. Allow inbound access in the firewall — a filter that checks connections against rules. On the router itself, the server needs only permitted inbound access.

WireGuard does not respond to unauthenticated clients. The device's other open services do not get this protection.

Check universal plug and play (UPnP), which lets applications create port forwards. Turn it off if you do not need it (then check your games and media services). Remove any unnecessary manual forwards.

Reserve a Fixed Address and Open Only the Necessary Port

Watch on YouTube

Restrict Access in Both Directions

The tunnel does not isolate the client. According to the Ubuntu documentation, home devices can also reach the connected client if the routes and firewall allow it. Configure the firewall for the VPN subnet on the server or gateway.

DirectionWhat to allow
VPN client → home networkOnly the devices and services you need
Home network → VPN clientReplies to requests; new connections only as needed
Client → server administrationMaintenance from a trusted device

For example, for documents while travelling, allow your phone access to the NAS file service while leaving the camera and router panels unreachable.

Restrict Access in Both Directions

Restrict Access in Both DirectionsForward exactly one user datagram protocol (UDP) port to the WireGuard server: it carries the tunnel's packets. home devices can also reach the connected client if the routes and firewall allow it. Configure the firewall for the VPN subnet on the server or gateway.tunnelthe connectedclientrouterWireGuard serverhome network

Forward exactly one user datagram protocol (UDP) port to the WireGuard server: it carries the tunnel's packets.

home devices can also reach the connected client if the routes and firewall allow it.

Configure the firewall for the VPN subnet on the server or gateway.

Prepare Keys, Updates and a Copy of the Settings

Issue a separate profile to each device. Store the private key and QR code like a password; do not post wg0.conf in full on a forum. Optionally, add a PresharedKey — a shared secret for additional symmetric encryption.

In Ubuntu, the unattended-upgrades package installs security updates daily. Rebooting is not automatic by default: check whether one is needed so that a new kernel starts working.

Change the router's factory password and disable any remote administration from the internet that you do not need. In the UK, check the published update period: the product security and telecommunications infrastructure regime for consumer connectable products, in force since 29 April 2024, requires the minimum support period to be disclosed. A router without updates is better replaced.

Create an archive with pivpn backup. Store it securely off the server: it contains profiles. When moving the settings to a new device, check the addresses, the interface and the firewall.

Before opening the port:

Frequently Asked Questions

Is a Raspberry Pi powerful enough?

Yes, it is suitable for running a VPN. Compatibility does not guarantee any particular speed. Even gigabit Ethernet on a Pi 5 does not remove the limits of your home connection: more detail in the piece on VPN throughput and routing.

Can I connect the server over Wi-Fi?

You can, but a cable is simpler. When switching from Ethernet, the interface changes and usually the address does too: you will need to check the reservation and the port forward and reconfigure PiVPN.

What should I do if I lose the phone with the profile?

Revoke the profile immediately with pivpn remove: its key will no longer connect. Issue a new profile for the new phone.

Choose a Server for Access to Your Home

A Raspberry Pi, an x86_64 PC, a NAS or a router with a server function will all work. Keep the system updated, reserve a fixed address, open a single port and restrict access with a firewall. Issue separate keys and keep a backup copy.

If you want to route the traffic of a TV or console at home through a VPN, I recommend CitadelVPN with a connection via the router. The MAX plan includes WireGuard/OpenVPN configurations and VLESS keys, and support helps with setup. Before choosing a plan, tell support your router's model and firmware version so they can check compatibility. The router acts as a client of the service; a home VPN server is not needed for this task.