Run Your Own VPN

Terje Rutgersen · 2026 · Guide

Your ISP logs every domain you visit. Not because they're evil, necessarily, but because they can, and because someone might ask them to hand it over. In some countries they're legally required to. In others they just do it because the data has value. Either way, your browsing history sits on someone else's server and you have no say in what happens to it.

A commercial VPN fixes part of this. You're trusting the VPN provider instead of your ISP. Maybe that's an improvement. Maybe not. You don't know what they log, and their "no logs" marketing copy is worth exactly as much as you paid their legal department to write it.

Running your own VPN fixes the whole thing. WireGuard makes this almost trivially easy. It's fast, it's modern, and the entire config fits in about ten lines. You need a cheap cloud server (this site runs on one that costs about six euros a month) and maybe twenty minutes.

What WireGuard actually is

It's a VPN tunnel built into the Linux kernel. Compared to OpenVPN or IPSec, the codebase is tiny (around 4,000 lines of code), which means fewer places for bugs to hide, faster connections, and way less configuration headache. You generate some keys, write a short config file, and you're done.

Setting it up

Install it on your server. On Debian or Ubuntu this is just:

sudo apt update
sudo apt install wireguard

Generate your server keys:

cd /etc/wireguard/
umask 077
wg genkey | tee privatekey | wg pubkey > publickey

Create the server config at /etc/wireguard/wg0.conf:

[Interface]
PrivateKey = [YourPrivateKey]
Address = 10.0.0.1/24
ListenPort = 51820

[Peer]
PublicKey = [ClientPublicKey]
AllowedIPs = 10.0.0.2/32

Enable IP forwarding so traffic can actually route through:

# Uncomment this in /etc/sysctl.conf:
net.ipv4.ip_forward=1

# Then apply:
sudo sysctl -p

Start it up and make it stick across reboots:

sudo wg-quick up wg0
sudo systemctl enable wg-quick@wg0

Connecting your devices

Install the WireGuard app on your phone or laptop. The config is just as short:

[Interface]
PrivateKey = [ClientPrivateKey]
Address = 10.0.0.2/32

[Peer]
PublicKey = [ServerPublicKey]
Endpoint = [ServerIP]:51820
AllowedIPs = 0.0.0.0/0

Replace the bracketed bits with your actual keys and server IP. Connect. That's it. All your traffic now goes through your server instead of leaking directly to your ISP. You control the server. Nobody else logs what goes through it.

Why bother

Because your traffic is your business. Because it costs less than a month of any commercial VPN and you actually know what's running. Because every service you don't outsource is one less company that has your data. And because honestly, once you've done it, you'll wonder why you ever paid NordVPN to do something this simple.