Setup
Set up WireGuard step by step
Prepare a profile per device, import it in the official app and verify connectivity without copying someone else’s settings.
Before importing
Install an official app compatible with your operating system and keep the device updated. Creating a VPN interface or changing routes requires permission; on a work device, consult the network administrator.
Get your configuration through your account. The file and QR contain private material: do not share them, upload them to online checkers or attach them to support requests without removing keys. Use a separate profile for each device.
- The official WireGuard application for your system: it is free, open source and available from wireguard.com/install.
- A .conf file or QR code generated in your account; it contains your private key, the server public key and the endpoint to connect to.
- Permission to create a VPN interface and change the routing table; on a work or corporate device, authorisation from whoever administers it.
What the profile contains
The Interface section describes your end: private key, tunnel address and, depending on the application, DNS or MTU. The Peer section identifies the server and networks routed to it.
Endpoint, DNS, AllowedIPs and IPv6 support must match your provider and access. Do not copy an address from a guide or add an IPv6 route assuming the server supports it. A full-tunnel setup needs coherent handling of both address families, including traffic that cannot be carried.
[Interface]
PrivateKey = YOUR_PRIVATE_KEY
Address = 10.7.0.42/32
DNS = 10.7.0.1
[Peer]
PublicKey = SERVER_PUBLIC_KEY
Endpoint = YOUR_ENDPOINT:51820
AllowedIPs = 0.0.0.0/0, ::/0
PersistentKeepalive = 25- PrivateKey: your cryptographic identity. It should only exist on your device.
- Address: the address your device receives inside the private network.
- DNS: the resolver used while the VPN is active; if it points at the provider’s resolver, queries do not go to another resolver, provided the system respects it.
- Peer PublicKey: the public key of the server you connect to.
- Endpoint: server address and port.
- AllowedIPs = 0.0.0.0/0, ::/0: tells the system that all IPv4 and IPv6 traffic must use the tunnel; this is what makes the profile a full tunnel.
- PersistentKeepalive: keeps the route open behind NAT, useful on phones and home routers.
Windows and macOS
Download WireGuard from the official source or the store linked by the project. Import your device’s file and check the tunnel name before enabling it. Approve only permissions associated with that application.
On Windows, managing tunnels may require an administrator account. On macOS, check permission to add a VPN configuration. On-demand connection options depend on the client and do not automatically mean all traffic outside the tunnel is blocked.
- Download the installer from wireguard.com/install and run it. No extra configuration is needed.
- Open the application. You will see an empty window with an Add Tunnel button at the bottom left.
- Click the arrow next to Add Tunnel and choose Import tunnel(s) from file. Pick the .conf file from your account.
- Once imported, click Activate. The system tray icon turns green when the tunnel is up.
- Install WireGuard from the Mac App Store (official build signed by the WireGuard Foundation).
- Open the app from the top menu bar. Click the icon and choose Manage Tunnels.
- Press the + button and select Import Tunnel(s) from File. Pick the .conf file from your account.
- Check the On-Demand box only if you understand how your client handles network and DNS changes.
- Toggle the tunnel switch to activate it.
iPhone, iPad and Android
Install the official app, choose file or QR import and give the profile a recognisable name. If scanning a QR from another screen, do not leave it visible afterwards and remove screenshots containing the configuration.
Allow VPN creation when prompted by the operating system. Enable the tunnel in the application and try basic browsing. Then check what happens when switching from Wi-Fi to mobile data or suspending the device; persistence and blocking options differ between iOS and Android.
- Install WireGuard from the App Store.
- Open it and tap +. There are three options: Create from scratch, Create from file or archive and Create from QR code.
- The fastest option is the QR code: point the camera at the code generated by your account and the tunnel is ready.
- Toggle the tunnel switch. iOS will ask for permission to add a VPN configuration: accept it.
- Then check what happens when you switch from Wi-Fi to mobile data and when you suspend the device.
- Install the official app from Google Play, or from F-Droid if you prefer to stay outside the Google ecosystem.
- Tap the floating + button and choose Scan from QR code or Import from file.
- Give the tunnel a name and save it. Toggle its switch.
- Android will ask for permission to create a VPN connection: grant it and read the system notice.
Linux and routers
On Linux use packages maintained by your distribution and restrict configuration-file permissions. Before enabling a full tunnel on a remote machine, prepare recovery access: changing the default route can disconnect your administration session.
For routers, confirm model and firmware, back up configuration and review per-device routing rules. Importing a profile does not mean all router networks, DNS queries or IPv6 connections are automatically redirected. Do not apply generic firewall instructions without checking their scope.
These are firmware examples listed for WireGuard in the source guide; they are not a guarantee of universal compatibility. Before importing a profile on the router, check the model and firmware version, and whether your device is on the supported list.
- OpenWrt: WireGuard is available in its repositories; confirm your model and version before importing the profile.
- ASUS Merlin: alternative firmware for ASUS routers; check that your model appears in the list for the version you install.
- FRITZ!OS: recent versions include a WireGuard client; verify model and firmware version before assuming support.
- MikroTik RouterOS: recent versions include WireGuard; review your device version and what its interface allows.
- pfSense and OPNsense: check WireGuard availability and the configuration procedure for your version.
# Debian / Ubuntu
sudo apt install wireguard
# Fedora
sudo dnf install wireguard-tools
# Arch
sudo pacman -S wireguard-toolssudo cp vikingpn.conf /etc/wireguard/
sudo chmod 600 /etc/wireguard/vikingpn.conf
# Bring the tunnel up
sudo wg-quick up vikingpn
# Check status
sudo wg show
# Bring it down
sudo wg-quick down vikingpn
# Enable on boot
sudo systemctl enable wg-quick@vikingpnVerify before relying on it
Check a recent server handshake, browsing by address and name, and IPv4, IPv6 and DNS behaviour. A byte counter indicates activity, not a privacy audit. If using an external diagnostic service, that service sees the IP and test data.
Disable the tunnel to check recovery of your ordinary connection. If problems occur, change one variable at a time and retain the original profile. The troubleshooting guide explains an order that avoids one DNS or MTU change concealing another issue.
- Public IP address: check which exit address a diagnostic service observes. That service sees your IP and the test data, so use it only if you accept that trade-off.
- DNS leaks: verify which resolvers answer while the tunnel is active. If your network operator’s or unrelated resolvers appear, the configuration is not applying the intended DNS.
- IPv6 leaks: if your connection uses IPv6 and the profile only routes IPv4, some traffic may leave outside the tunnel. Check that AllowedIPs and the system policy cover both families.
Security good practice
These checks reduce the risk of reusing private material or losing control of a device.
- Do not reuse the same file across devices: each device needs its own key and profile.
- If you lose or replace a device, revoke its access in your account and generate a new one.
- Check whether your client blocks traffic when the tunnel drops; on iOS and Android that option depends on the system and the client.
- Keep the application updated: recent versions fix compatibility with networks and address families.
Frequently asked questions
These are the questions that come up most when preparing, importing and maintaining a WireGuard profile.
Is WireGuard secure compared with OpenVPN?
WireGuard uses modern cryptography (ChaCha20, Poly1305, Curve25519) and a much smaller codebase, which makes it easier to review. That does not make it immune to configuration mistakes: security also depends on keys, routes and the system it runs on.
Does WireGuard work behind NAT or CGNAT?
Yes, provided the client starts the connection and the network allows outbound UDP. PersistentKeepalive helps keep the NAT mapping open; it does not guarantee crossing every restriction.
Can I use WireGuard without the official app?
Other implementations exist, but the official application is the reference maintained by the project. If you use another one, check its origin and its compatibility with the profile format.
Does WireGuard use much battery on mobile?
Its overhead is lower than heavier protocols such as OpenVPN or IKEv2 on most devices, but consumption depends on usage, the network and whether the system keeps the tunnel active. We do not promise a figure.
Do I need a different key for each device?
Yes. Each device needs its own key pair and profile; sharing one key breaks the protocol’s identity model and can cause intermittent disconnections.
