WireGuard config generator
How to use the configs
- On the server:
apt install wireguard iptables, save the server config as/etc/wireguard/wg0.conf, then turn on forwarding withecho "net.ipv4.ip_forward = 1" > /etc/sysctl.d/90-wireguard.conf && sysctl --system. - Start it with
systemctl enable --now wg-quick@wg0. - Open the UDP port in your firewall, or forward it to the server.
- Import each client file into the WireGuard app on that device, or paste it in.
The full walkthrough, with QR codes for phones: set up a WireGuard VPN.
Good to know
- Keys are made with your browser's built-in X25519 support (Web Crypto). Current Chrome, Edge, Firefox and Safari have it. Each client gets a preshared key too, for extra protection.
- "All traffic" sets
AllowedIPs = 0.0.0.0/0, ::/0. The tunnel carries IPv4 only, so IPv6 is blocked while connected instead of leaking around the VPN. - Treat private keys like passwords. Anyone with a client file can join your VPN.
WireGuard config questions
Is it safe to generate WireGuard keys in a browser?
Yes, here. The keys are made on your device with the browser's own cryptography, and the page sends nothing anywhere. You can disconnect from the internet after the page loads and it still works.
What is PersistentKeepalive for?
It sends a tiny packet every 25 seconds, so routers and NAT do not forget the connection. Without it, a phone behind NAT may stop receiving traffic until it sends something.
Can I add more clients later?
Yes, but this page makes a new server key each time, so do not replace your server config. On the server, run wg genkey | tee client.key | wg pubkey for the new device, add a [Peer] block with that public key and the next free address, and give the device a config like the ones above with your existing server public key (wg show wg0 public-key). The WireGuard guide has the details.
Where can I run the server?
Any Linux server with a public UDP port. A natbox VPN server costs $2.75 for 3 months and installs WireGuard for you, with an ad blocker if you like. See WireGuard VPN hosting.
More free tools: all tools, open port checker, IPv6 subnet calculator.