WireGuard Config Generator

Keys, a server wg0.conf and a config with a QR code for each peer, made in the browser.

About WireGuard Config Generator

A WireGuard config generator that makes the keys, a server wg0.conf and a config with a QR code for each peer, all inside your browser.

How to use

  1. Enter the server endpoint (the host name or IP address clients connect to) and the listen port.
  2. Enter the server's address inside the tunnel with the tunnel's prefix, such as 10.0.0.1/24, and the number of peers. Peers get the next free addresses.
  3. Choose what peers send through the tunnel: all traffic, only the tunnel network, or your own list of ranges. Add DNS servers, a keepalive and preshared keys if you want them.
  4. Copy or download wg0.conf for the server and one .conf file per peer, or scan a peer's QR code in the WireGuard mobile app. New keys makes a fresh set.

What it does

  • Makes X25519 key pairs the way wg genkey and wg pubkey do: 32 random bytes from the browser's secure random generator, clamped, with the public key derived from them. Preshared keys are 32 random bytes, as from wg genpsk.
  • Writes a server config with one [Peer] section per client, each allowed its own /32 address, and a client config per peer with Address, DNS, Endpoint, AllowedIPs and PersistentKeepalive.
  • Puts an IPv6 endpoint in square brackets, and skips the network, broadcast and server addresses when it numbers the peers.
  • Accepts the private key of a running server, so new peers can be added to it, and has a separate box that turns any private key into its public key.
  • Does not add PostUp firewall rules or turn on IP forwarding. A full tunnel needs both on the server, and the exact commands depend on its firewall and network interface. The tunnel range is IPv4 only.

Example

Endpoint vpn.example.com, port 51820, tunnel 10.0.0.1/24, 1 peer

wg0.conf                         peer1.conf
[Interface]                      [Interface]
Address = 10.0.0.1/24            PrivateKey = (peer key)
ListenPort = 51820               Address = 10.0.0.2/32
PrivateKey = (server key)        DNS = 1.1.1.1

[Peer]                           [Peer]
# Peer 1                         PublicKey = (server public key)
PublicKey = (peer public key)    Endpoint = vpn.example.com:51820
AllowedIPs = 10.0.0.2/32         AllowedIPs = 0.0.0.0/0, ::/0
                                 PersistentKeepalive = 25

Privacy

Keys are generated in your browser and never sent anywhere; the page makes no request with your settings or keys and stores nothing. Reloading the page discards them, so download the files you need first.

Frequently asked questions

Is it safe to generate WireGuard keys in a browser?
Here the keys are made by code running on your own device, using the browser’s secure random number generator, and are never uploaded. Once the page has loaded you can disconnect from the network and it still works. If your policy requires keys to be made on the server, use wg genkey there and paste the server key into the optional field.
What does AllowedIPs mean in WireGuard?
On a client it lists the destinations sent through the tunnel: 0.0.0.0/0, ::/0 sends everything. On the server, each peer’s AllowedIPs is the address that peer may use inside the tunnel, usually a single /32.
What is a preshared key in WireGuard?
An optional extra secret shared by the two ends of one peer connection. WireGuard mixes it into the handshake as an additional layer of symmetric encryption, for post-quantum resistance. Both configs for that peer must carry the same value.
What PersistentKeepalive value should I use?
For a peer behind NAT or a firewall, 25 seconds is the interval the WireGuard documentation suggests. Leave it blank for a peer that does not need to stay reachable while idle.