natbox.io

WireGuard config generator

A server wg0.conf and ready-to-import client configs, with fresh keys. Everything runs in your browser: no key is ever sent to us.


The public IP or domain your devices connect to.

A private /24 not used on your home network.

Find it with ip route get 1.1.1.1.
Traffic
Unticked: only traffic to the VPN network uses the tunnel.

How to use the configs

  1. On the server: apt install wireguard iptables, save the server config as /etc/wireguard/wg0.conf, then turn on forwarding with echo "net.ipv4.ip_forward = 1" > /etc/sysctl.d/90-wireguard.conf && sysctl --system.
  2. Start it with systemctl enable --now wg-quick@wg0.
  3. Open the UDP port in your firewall, or forward it to the server.
  4. 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

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.