---
title: 'Set Up a WireGuard VPN on Your Home Server in 20 Minutes'
url: 'http://itlad.uk/blog/wireguard-vpn-home-server-setup'
markdown: 'http://itlad.uk/blog/wireguard-vpn-home-server-setup.md'
date: '2026-05-24'
description: 'Step-by-step WireGuard VPN setup on a home server — install, configure server and client, port forwarding, and connect your phone in under 20 minutes.'
taxonomy:
  category:
    - networking
    - cybersecurity
  tag:
    - wireguard
    - vpn
    - homelab
    - networking
    - security
---

[ Home ](http://itlad.uk/)     [ Blog ](http://itlad.uk/blog)      Set Up a WireGuard VPN on Your Home Server in 20 Minutes    

# [Set Up a WireGuard VPN on Your Home Server in 20 Minutes](http://itlad.uk/blog/wireguard-vpn-home-server-setup)

 By [IT Lad](http://itlad.uk/about) 24 May 2026 

  [wireguard](http://itlad.uk/blog/tag:wireguard#body-wrapper) [vpn](http://itlad.uk/blog/tag:vpn#body-wrapper) [homelab](http://itlad.uk/blog/tag:homelab#body-wrapper) [networking](http://itlad.uk/blog/tag:networking#body-wrapper) [security](http://itlad.uk/blog/tag:security#body-wrapper)  

WireGuard is 4,000 lines of code. OpenVPN is 600,000. Fewer lines means a smaller attack surface, faster handshakes and speeds that actually match your connection.

This guide uses wg-easy — a Docker container that wraps WireGuard with a web UI for managing peers.

## Prerequisites

- A Linux server or VM on your home network (Ubuntu 22.04+ or Debian 12)
- A port you can forward on your router (UDP, default 51820)
- Docker installed

## Install wg-easy

```bash
docker run -d \
  --name=wg-easy \
  -e WG_HOST=your.domain.or.ip \
  -e PASSWORD=changeme \
  -v ~/.wg-easy:/etc/wireguard \
  -p 51820:51820/udp \
  -p 51821:51821/tcp \
  --cap-add=NET_ADMIN \
  --cap-add=SYS_MODULE \
  --sysctl="net.ipv4.conf.all.src_valid_mark=1" \
  --sysctl="net.ipv4.ip_forward=1" \
  --restart unless-stopped \
  ghcr.io/wg-easy/wg-easy
```

Replace `your.domain.or.ip` with your public IP or a dynamic DNS hostname.

## Port Forwarding

Log into your router and forward UDP port 51820 to the internal IP of your Docker host. If your ISP assigns a dynamic IP, set up a free dynamic DNS service — DuckDNS works well and integrates easily.

## Create Your First Peer

Open `http://your-server-ip:51821` in a browser. Log in with the password you set. Click "New Client," name it (e.g. "phone" or "laptop"), and download or scan the QR code.

Install the WireGuard app:

- [WireGuard for Android](https://www.amazon.com/s?k=wireguard%2Bvpn%2Bandroid&tag=itlad-21) — on the Play Store
- WireGuard for iOS — App Store
- WireGuard for Windows/Mac — wireguard.com/install

Import the config via QR code or file. Toggle the VPN on. Your traffic now routes through your home network.

## Verify It Works

With the VPN connected on your phone, visit `https://whatismyip.com`. It should show your home IP, not your mobile carrier's IP.

## Security Hardening

- Change the web UI password from the default immediately
- Put the wg-easy management port (51821) behind your firewall — it should not be publicly accessible
- Use a subdomain with Nginx Proxy Manager in front of the UI if you need remote management access
- Rotate peer keys every few months for sensitive devices

## Hardware Note

Any machine running Docker handles this fine. A [Raspberry Pi 4 4GB](https://www.amazon.com/s?k=raspberry%2Bpi%2B4%2B4gb&tag=itlad-21) runs wg-easy for 5–10 peers without breaking a sweat.

---

*As an Amazon Associate, IT Lad earns from qualifying purchases made through links on this page. [Read the full affiliate disclosure](http://itlad.uk/affiliate-disclosure).*

 [ Previous Post](http://itlad.uk/blog/budget-network-switches-homelab) [Next Post ](http://itlad.uk/blog/vscode-extensions-sysadmins)

#### Syndicate

 [ Atom 1.0](http://itlad.uk/blog.atom) [ RSS](http://itlad.uk/blog.rss)

---

## Navigation

- Parent: [Blog](http://itlad.uk/blog.md)
- Previous: [Best VSCode Extensions for Sysadmins and IT Pros](http://itlad.uk/blog/vscode-extensions-sysadmins.md)
- Next: [Best Budget Network Switches for Your Homelab in 2026](http://itlad.uk/blog/budget-network-switches-homelab.md)
