Build Your Own Private VPN with WireGuard

Spin up a VPN on a Vultr instance, connect your phone, and watch your IP address change.

+60

POINTS

What you will build

Your own VPN server. No subscription, no third party, and no one else's logs. Connect on café Wi-Fi and your traffic leaves from the Vultr region you picked.

Starting point: you only need a Vultr account. This challenge is self-contained, so you can do it without having done any other.

The plan

  1. Deploy an Ubuntu 24.04 Cloud Compute instance in a region of your choice
  2. Install WireGuard and generate a server key pair
  3. Enable IP forwarding and NAT so traffic can leave through the server
  4. Open UDP port 51820 in a Vultr Firewall group
  5. Create a client config and import it on your phone via QR code
  6. Check your public IP before and after connecting
BASH
sudo apt update && sudo apt install -y wireguard qrencode
wg genkey | tee server.key | wg pubkey > server.pub

Show it works

Search for "what is my IP" with the VPN off, then on. The second result should be your Vultr instance's address and region.

Never share or commit your private keys. Only public keys leave the machine.

Stretch goals

  • Add a second device as another peer
  • Route only specific traffic through the tunnel (split tunnelling)
  • Compare latency with and without the VPN

Requirements

WireGuard running on a Vultr instance

A client connected and passing traffic

Public IP shown before and after

UDP 51820 allowed in a Vultr Firewall group

Resources

Submit Your Build

Challenge Questions

No questions about this Challenge yet
Ask anything about this Challenge prep, agenda or joining.