Quick answer
How do I make a WireGuard QR code for a phone?
To make a WireGuard QR code, install qrencode on the TunnelVPS server and run qrencode -t ANSIUTF8 < phone.conf in the SSH terminal. The phone's client file appears as a code on screen. Scan it from the WireGuard app on iPhone or Android, then clear the terminal. It takes 4 steps and under a minute.
In brief
- Tool:
qrencode, installed with apt on Debian or Ubuntu. - Terminal code:
-t ANSIUTF8draws the code with text characters. - Image:
-o phone.pngwrites a PNG, the default output type. - Safety: the code holds the phone's private key; clear it after the scan.
What are the 4 steps to make the QR code?
| Step | Where | What to do |
|---|---|---|
| 1 | Server | Install the tool with apt install qrencode. |
| 2 | Server | Write the phone's client file, for example /etc/wireguard/clients/phone.conf. |
| 3 | SSH terminal | Run qrencode -t ANSIUTF8 < phone.conf and scan the code from the WireGuard app. |
| 4 | SSH terminal | Run clear, and delete any PNG copy of the code. |
Why use a WireGuard QR code instead of a file?
Because a phone has no easy way to receive a config file over SSH, but its camera reads a code in a second. The WireGuard apps for iOS and Android both import a tunnel from a QR code.
The code is the whole client file in another form. Nothing travels through email, chat or a cloud drive. The iPhone guide and the Android guide show the scan screen in each app.
How does qrencode turn the file into a code?
It reads text from standard input when no string is given, and draws it in the output type chosen with -t. TunnelVPS read the qrencode manual on 16 November 2026. The types include PNG (the default), UTF8 and ANSIUTF8.
ANSIUTF8 suits most terminals: it uses block characters and colour codes. If the code looks broken, widen the window or try -t UTF8. The < sign feeds the file into the command.
apt install qrencode
cd /etc/wireguard/clients
qrencode -t ANSIUTF8 < phone.conf
# after the scan:
clearCan you save the code as an image instead?
Yes: -o writes the code to a file, and PNG is the default type. This helps when the phone is not next to the computer running the SSH session. Copy the PNG down with scp, show it on screen, scan it, then delete both copies.
Never post that image anywhere. Anyone who photographs it can connect as that phone until its peer is removed from the server.
qrencode -o /root/phone.png < /etc/wireguard/clients/phone.conf
# copy it down from your computer:
# scp [email protected]:/root/phone.png .
rm /root/phone.pngWhat must be in the file before you encode it?
A complete client config: the phone's private key and address, then the server's public key and endpoint. A missing Endpoint or wrong key gives a tunnel that imports fine but never shakes hands.
The add a device guide builds that file and the matching [Peer] on the server. Make the WireGuard QR code only after the peer is live, so the phone can test it at once.
Is there a WireGuard QR code option without the terminal?
Yes: wg-easy shows a QR code for each client on its web page. It suits a server shared by many people. The trade-off is a web admin page to protect.
The wg-easy install guide covers it. For a handful of phones, qrencode in the SSH window is quicker and adds no service to the server.
QR code questions
Does the WireGuard QR code contain the private key?
Yes. It holds the whole client file, private key included. Treat it like a password.
Can one QR code be used on two phones?
It can be scanned twice, but both phones then share one peer and knock each other off. Make one code per phone.
Which is the best way to make a WireGuard QR code in 2026?
qrencode -t ANSIUTF8 in the SSH session: the key never leaves the encrypted channel.
Can a laptop scan the code?
Desktop apps import the .conf file instead. Copy it with scp, as each device guide shows.
The code is too big for my terminal. What now?
Enlarge the window or reduce the font size, or write a PNG with -o and delete it after scanning.
Verdict
qrencode -t ANSIUTF8 < phone.confis the quickest way to get a tunnel onto a phone.- Clear the screen and delete PNG copies: the code is a key.
Sources (3)
- qrencode(1) manual page — Debian (read 2026-11-16)
- WireGuard: Installation and client apps — WireGuard (read 2026-11-16)
- wg-easy repository — GitHub (read 2026-11-16)
A server for every phone in the house
Home carries a household of phones with 5 TB a month, at $6.37 a month on 12 months.
- Built by a person, 1 hour at most after confirmation
- Lost days credited back if a server cannot be delivered
- Pay in BTC, XMR, USDT, USDC, ETH, SOL or LTC
- DomaineGoat LLC · Panama