WireGuard config to QR code
Paste a client .conf and scan the result with the WireGuard app on Android or iOS.
1Client configuration
The QR code is drawn by JavaScript in this page. The file and its private key are never sent to our server: only an anonymous counter of conversions is.
2Scan it
The code for the phone appears here.
On the server, without a browser
If you are already in an SSH session on the server, qrencode prints the same code in the terminal:
sudo apt install qrencode qrencode -t ansiutf8 < client.conf
Use a terminal with a dark background and a font small enough for the whole code to fit, otherwise the phone will not read it. -t png -o client.png writes an image instead.
Why the app says the QR code is invalid
- A server file was encoded
- The phone needs the client side: its own PrivateKey and Address in [Interface], and the server's PublicKey and Endpoint in [Peer]. A wg0.conf with several [Peer] sections is the server file.
- A key was cut or edited
- Every key is 44 characters ending in "=". A missing character or a line break inside a key makes the app reject the whole file.
- An unknown field
- A typo in a field name (AllowedIP, Keepalive) or a field from another tool stops the import. The tool above lists these before you scan.
- The code is too dense to read
- Long PostUp lines and comments add data. Remove comments and lines the client does not need before you encode it.
A QR code for every device, kept in one place
WireGuard Manager keeps the server and its peers: adding a phone gives you the next free address, new keys and its QR code in one step, and a lost device is revoked by rotating its keys. Free for 1 server and 3 peers, Pro at 9 EUR/month for unlimited servers and peers. Already running a server? Its wg0.conf can be imported as it is.