WireGuard Config Generator
Generate WireGuard wg0.conf files with X25519 key pairs for a client or server. Keys are created on your device.
Key generation
Never share a private key — treat it like a password.
Interface
Peer
sudo chmod 600 /etc/wireguard/wg0.conf— restrict permissions on the key file- start the tunnel with sudo wg-quick up wg0 (wg-quick down wg0 to stop)
net.ipv4.ip_forward=1— enable forwarding on the server side
Runs in your browser. Nothing you open or type here is uploaded.
How to use
- Choose the role: Client for the device connecting through the VPN, Server for the machine accepting connections.
- Generate an X25519 key pair, or paste existing keys. A generated private key can fill the interface field.
- Fill in the addresses, endpoint, allowed IPs and DNS. On a server, optionally add the NAT masquerade rules.
- Download wg0.conf and install it with the commands shown below.
Details
A WireGuard config file pairs an [Interface] section — the device's own private key and tunnel addresses — with one [Peer] section per remote end. This tool generates the file for one side: a client that connects out, or a server that accepts connections and can optionally add NAT masquerade PostUp and PreDown rules so clients reach the network beyond it. Key pairs are X25519, generated with WebCrypto in your browser, and an optional preshared key can be added for the peer. Save the result as /etc/wireguard/wg0.conf and bring the tunnel up with wg-quick.
- Treat the config like a password: it contains a private key. Run sudo chmod 600 on /etc/wireguard/wg0.conf and never share the file.
- The server needs IP forwarding enabled (net.ipv4.ip_forward=1) for clients to reach anything beyond the server itself.
- Each side needs the other side's public key. Generate the client and server configs separately, then swap the public keys between them.
Common questions
Are my private keys safe here?
Yes. Keys are generated with WebCrypto inside your browser and are never sent anywhere.
Client or server — which one do I need?
Choose Client for the laptop or phone connecting through the VPN. Choose Server for the machine accepting connections; the server mode can also add NAT masquerade PostUp/PreDown rules.
How do I use the generated config?
Save it as /etc/wireguard/wg0.conf, run sudo chmod 600 on it, then start it with sudo wg-quick up wg0. The server also needs IP forwarding enabled (net.ipv4.ip_forward=1).