WireGuard VPS Installatiehandleiding 2026: Bouw Je Eigen VPN
Stel WireGuard VPN in op je VPS in 10 minuten. Volledige handleiding met configuratie, client-installatie en beste beveiligingspraktijken.
WireGuard VPS Installatie: Je Eigen VPN in 10 Minuten
WireGuard is het snelste en eenvoudigste VPN-protocol. Stel het in op een goedkope VPS en je hebt je eigen privé-VPN — geen abonnementen, geen logs, volledige controle.
Waarom WireGuard?
| VPN-protocol | Snelheid | Eenvoud | Codeomvang |
|---|---|---|---|
| WireGuard | Snelst | ~4.000 regels | Klein |
| OpenVPN | Goed | ~100.000 regels | Groot |
| IPSec | Goed | ~400.000 regels | Enorm |
WireGuard is:
- Sneller — Implementatie op kernelniveau
- Eenvoudiger — Minder code = minder bugs
- Modern — State-of-the-art cryptografie
- Batterijvriendelijk — Uitstekend voor mobiel
VPS-vereisten
WireGuard is ongelooflijk licht:
- CPU: Willekeurig
- RAM: 64MB voor WireGuard zelf
- Opslag: <10MB
- Netwerk: Goede connectiviteit, statisch IP
De VPS-specificaties zijn belangrijker voor je bandbreedte dan voor WireGuard.
Beste VPS voor WireGuard
| Provider | Plan | Prijs | Beste voor |
|---|---|---|---|
| Vultr | VC2 | $6/mnd | 32 locaties |
| Hetzner | CX11 | €3,79/mnd | Beste waarde |
| Hostinger | KVM1 | $4,99/mnd | Goed allround |
| DigitalOcean | Basic | $6/mnd | Eenvoudige installatie |
Voor VPN is locatie het belangrijkst. Kies een regio dicht bij je voor snelheid, of ver weg om geoblokkades te omzeilen.
Snelle Installatie (5 Minuten)
Stap 1: VPS Aanmaken
Elke Ubuntu 22.04+ VPS werkt. Log in via SSH:
ssh root@your-vps-ip
Stap 2: WireGuard Installeren
apt update
apt install wireguard -y
Stap 3: Sleutels Genereren
cd /etc/wireguard
wg genkey | tee privatekey | wg pubkey > publickey
chmod 600 privatekey
Stap 4: Serverconfiguratie Aanmaken
cat > /etc/wireguard/wg0.conf << 'EOF'
[Interface]
PrivateKey = YOUR_SERVER_PRIVATE_KEY
Address = 10.0.0.1/24
ListenPort = 51820
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
[Peer]
PublicKey = CLIENT_PUBLIC_KEY
AllowedIPs = 10.0.0.2/32
EOF
Vervang:
YOUR_SERVER_PRIVATE_KEYdoor de inhoud vanprivatekeyCLIENT_PUBLIC_KEYdoor de publieke sleutel van je client (die genereren we hierna)
Stap 5: IP-forwarding Inschakelen
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
sysctl -p
Stap 6: Firewall Openzetten
ufw allow 51820/udp
Stap 7: WireGuard Starten
systemctl enable wg-quick@wg0
systemctl start wg-quick@wg0
Verifieer:
wg show
Client-installatie
Clientsleutels Genereren
Op de server:
cd /etc/wireguard
wg genkey | tee client1-privatekey | wg pubkey > client1-publickey
Clientconfiguratie Aanmaken
cat > client1.conf << 'EOF'
[Interface]
PrivateKey = CLIENT_PRIVATE_KEY
Address = 10.0.0.2/24
DNS = 1.1.1.1
[Peer]
PublicKey = SERVER_PUBLIC_KEY
Endpoint = YOUR_VPS_IP:51820
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 25
EOF
Vervang:
CLIENT_PRIVATE_KEYdoor de inhoud vanclient1-privatekeySERVER_PUBLIC_KEYdoor de inhoud vanpublickeyYOUR_VPS_IPdoor het IP-adres van je VPS
Client aan Server Toevoegen
Bewerk /etc/wireguard/wg0.conf en voeg toe:
[Peer]
PublicKey = CONTENTS_OF_CLIENT1_PUBLICKEY
AllowedIPs = 10.0.0.2/32
Herladen:
wg syncconf wg0 <(wg-quick strip wg0)
Configuratie naar Client Overzetten
Optie 1: QR-code (voor mobiel)
apt install qrencode
qrencode -t ansiutf8 < client1.conf
Optie 2: Bestand veilig kopieren
cat client1.conf
# Copy contents to your device
Client-installatie per Platform
macOS
brew install wireguard-tools
# Create /etc/wireguard/wg0.conf with client config
sudo wg-quick up wg0
Of gebruik de WireGuard-app uit de Mac App Store.
Windows
- Download van wireguard.com
- Tunnel importeren → configuratie plakken
- Activeren
Linux
sudo apt install wireguard
# Create /etc/wireguard/wg0.conf
sudo wg-quick up wg0
iOS/Android
- Installeer de WireGuard-app
- Tunnel toevoegen → QR-code scannen of bestand importeren
- Verbinden
Meerdere Clients
Elke client heeft unieke sleutels en een uniek IP nodig:
# Generate for client2
wg genkey | tee client2-privatekey | wg pubkey > client2-publickey
Toevoegen aan serverconfiguratie:
[Peer]
PublicKey = CLIENT2_PUBLIC_KEY
AllowedIPs = 10.0.0.3/32
Maak de client2-configuratie aan met:
- Zijn eigen privesleutel
- Address = 10.0.0.3/24
Split Tunneling
Routeer alleen specifiek verkeer via de VPN:
Alleen Bepaalde IP’s Routeren
In de clientconfiguratie:
AllowedIPs = 10.0.0.0/24, 192.168.1.0/24
Alleen deze subnetten gaan via de VPN.
Lokaal Netwerk Uitsluiten
AllowedIPs = 0.0.0.0/0, ::/0
PostUp = ip route add 192.168.1.0/24 via 192.168.1.1
DNS-configuratie
Cloudflare DNS Gebruiken
In de clientconfiguratie:
DNS = 1.1.1.1, 1.0.0.1
Je Eigen DNS Gebruiken (Pi-hole)
Als je Pi-hole op dezelfde VPS draait:
DNS = 10.0.0.1
DNS-lekken Blokkeren
Op de server, externe DNS blokkeren:
iptables -I FORWARD -i wg0 -p udp --dport 53 -j DROP
iptables -I FORWARD -i wg0 -p tcp --dport 53 -j DROP
iptables -I FORWARD -i wg0 -d 10.0.0.1 -p udp --dport 53 -j ACCEPT
Prestatie-optimalisatie
MTU-afstemming
Optimale MTU vinden:
ping -c 5 -M do -s 1400 your-vps-ip
# Decrease until no fragmentation
Instellen in configuratie:
[Interface]
MTU = 1420
Persistent Keepalive
Voor clients achter NAT:
PersistentKeepalive = 25
Stuurt elke 25 seconden een pakket om de verbinding actief te houden.
Beveiligingsverharding
Standaardpoort Wijzigen
Gebruik een niet-standaard poort (minder scanning):
Server:
ListenPort = 44321
Client:
Endpoint = your-vps-ip:44321
Fail2Ban voor WireGuard
# WireGuard doesn't log auth failures by default
# But you can monitor connection attempts
cat > /etc/fail2ban/jail.d/wireguard.local << 'EOF'
[wireguard]
enabled = false
# WireGuard is already secure by design
EOF
WireGuard is van nature veilig — onbekende sleutels worden stilletjes genegeerd.
Firewall Alleen voor WireGuard-poort
Voor een uitgebreide firewall-configuratie, zie onze VPS-beveiligingshandleiding.
ufw default deny incoming
ufw allow ssh
ufw allow 51820/udp
ufw enable
Probleemoplossing
Kan Geen Verbinding Maken
# Check WireGuard is running
wg show
# Check firewall
ufw status
# Check port is open
nc -zvu your-vps-ip 51820
Geen Internet via VPN
# Check IP forwarding
cat /proc/sys/net/ipv4/ip_forward
# Should be 1
# Check NAT rules
iptables -t nat -L POSTROUTING
Lage Snelheden
# Test without VPN
speedtest-cli
# Test with VPN
# If much slower, try different MTU
Verbinding Valt Weg
Voeg toe aan de client:
PersistentKeepalive = 25
Gebruik met Docker
WireGuard Container
version: '3.8'
services:
wireguard:
image: linuxserver/wireguard
container_name: wireguard
cap_add:
- NET_ADMIN
- SYS_MODULE
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
- SERVERURL=your-vps-ip
- PEERS=5
volumes:
- ./config:/config
ports:
- 51820:51820/udp
sysctls:
- net.ipv4.conf.all.src_valid_mark=1
restart: unless-stopped
Genereert automatisch configuraties voor 5 peers in ./config/peer*.
WireGuard vs Commerciele VPN
| Factor | WireGuard VPS | NordVPN/etc |
|---|---|---|
| Kosten | ~$5/mnd | $3-12/mnd |
| Servers | 1 (van jou) | 5000+ |
| Snelheid | Snelst | Goed |
| Privacy | Volledig | Vertrouw hen |
| Logging | Geen | ”Geen logs” |
| Controle | Volledig | Geen |
Je eigen VPS = je eigen regels. Als je de voorkeur geeft aan zero-config VPN met SSO, bekijk dan Tailscale.
Multi-locatie Setup
Voor meerdere uitgangspunten:
- Maak een VPS aan in verschillende regio’s
- Stel WireGuard in op elk ervan
- Maak configuraties aan voor elk
- Wissel ertussen
# Switch to US exit
wg-quick down wg0
wg-quick up wg-us
# Switch to EU exit
wg-quick down wg-us
wg-quick up wg-eu
Veelgestelde Vragen
Is WireGuard veilig?
Absoluut. Maakt gebruik van moderne cryptografie (Curve25519, ChaCha20, Poly1305). Geauditeerd door beveiligingsonderzoekers.
Kan mijn ISP zien dat ik een VPN gebruik?
Ze kunnen versleuteld verkeer naar het IP-adres van je VPS zien, maar niet de inhoud.
Hoeveel apparaten kunnen verbinding maken?
Onbeperkt. Voeg meer [Peer]-secties toe.
Werkt WireGuard in China?
Soms. Het kan worden geblokkeerd. Overweeg obfuscatietools zoals udp2raw.
WireGuard vs OpenVPN?
WireGuard is sneller en eenvoudiger. OpenVPN is meer configureerbaar. Voor de meeste gebruikers wint WireGuard.
Aanbevolen Setup
| Gebruikssituatie | VPS | Locatie |
|---|---|---|
| Algemene privacy | Hetzner CX11 | Dichtstbijzijnde regio |
| Streaming VS | Vultr | VS (NYC, LA) |
| Streaming VK | Vultr | Londen |
| Maximale snelheid | Lokale regio | Zelfde land |
€3,79/maand geeft je een privé-VPN die sneller is dan elke commerciele optie. Geen logs, geen limieten, gewoon je eigen server.
Ready to get started?
Get the best VPS hosting deal today. Hostinger offers 4GB RAM VPS starting at just $4.99/mo.
Get Hostinger VPS — $4.99/mo// up to 75% off + free domain included
// related topics
// related guides
Tailscale VPS Setup Guide 2026: Secure Access Without Port Forwarding
Set up Tailscale on your VPS for secure remote access without opening ports. Connect your servers, home network, and devices in minutes.
reviewBest VPS for VPN in 2026 — Run WireGuard in 5 Minutes
Build your own VPN for $3.95/mo. We compare the 5 best VPS providers for WireGuard and OpenVPN — faster and cheaper than any VPN subscription.
tutorial$1 VPS Hosting 2026: Cheapest VPS Servers Starting at $1/Month
Looking for $1 VPS hosting? Compare the cheapest VPS providers starting from $1-3/month. Real specs, no hidden fees, honest reviews of budget VPS options.
tutorialCaddy Reverse Proxy Guide 2026: Automatic HTTPS Made Easy
Set up Caddy as a reverse proxy with automatic HTTPS, zero-config SSL, and simple Caddyfile syntax. Complete VPS deployment guide.
Andrius Putna
I am Andrius Putna. Geek. Since early 2000 in love tinkering with web technologies. Now AI. Bridging business and technology to drive meaningful impact. Combining expertise in customer experience, technology, and business strategy to deliver valuable insights. Father, open-source contributor, investor, 2xIronman, MBA graduate.
// last updated: February 8, 2026. Disclosure: This article may contain affiliate links.