A peer's keys and configuration, in one click
Adding a user to a WireGuard VPN takes three things: a key pair for their device, an entry for that key on the
server, and a configuration file to import into their client. The generator creates the keys with your
browser's Web Crypto API, on the X25519 curve, exactly like wg genkey and wg pubkey:
32 bytes encoded in Base64. It then fills in the peer's wg0.conf file with the settings you
provide.
Everything is computed in the page, which is not allowed to make network requests. X25519 in Web Crypto requires a recent browser: if yours does not offer it, the page tells you instead of failing silently.
The peer's file
[Interface]
PrivateKey = <peer private key>
Address = 10.0.0.2/32
DNS = 10.0.0.1
[Peer]
PublicKey = <server public key>
PresharedKey = <pre-shared key, optional>
Endpoint = vpn.example.com:51820
AllowedIPs = 10.0.0.0/24
PersistentKeepalive = 25
- Address: the peer's address inside the tunnel, unique to each user.
- DNS: the name server to use once connected. This line is applied by
wg-quickand by the official WireGuard apps; on Linux,wg-quickrelies onresolvconffor this. - PublicKey: the server's public key (not the peer's), shown on the server by
wg show. - Endpoint: the server's public address and UDP port.
- AllowedIPs: what goes through the tunnel.
0.0.0.0/0, ::/0routes all traffic through it; a specific network, such as10.0.0.0/24, limits the VPN to internal resources. - PersistentKeepalive: a signal every 25 seconds that keeps the tunnel open when the peer is behind a router or firewall doing address translation (NAT).
The pre-shared key
Optional, the pre-shared key (the equivalent of wg genpsk) adds a layer of
symmetric encryption between this peer and the server. It protects traffic recorded today against a future
quantum computer able to break X25519. If you enable it, the same value must be set on both sides.
Declare the peer on the server
The server only needs the peer's public key, never its private key. Add a section to its configuration:
[Peer]
PublicKey = <peer public key>
PresharedKey = <same pre-shared key>
AllowedIPs = 10.0.0.2/32
On the server side, AllowedIPs is the address assigned to the peer. The generated file, for its
part, is imported into the client: on Linux with wg-quick up, and in the Windows, macOS, Android
and iOS apps by importing a tunnel file.
Hand the configuration to the user
The safest approach is for each user to generate their key pair on their own device and share only their public key. When the administrator prepares the full configuration, the file contains the peer's private key: it opens the VPN to whoever holds it.
“Send with onlyU” sends the entire configuration file. onlyU encrypts it in your browser and creates a link the user can open only once, valid for 24 hours, after which the link disappears. For a line-by-line explanation, read our guide on how to configure a WireGuard peer.