October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk6 min

How to Set Up a WireGuard VPN for Secure Access to Your Server

Set up WireGuard to reach your server from outside your network. Choose the right routes, create peer keys, make the UDP endpoint reachable, and test the services you need.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To reach your own server remotely with WireGuard, configure a peer on the server and another on your device, choose exactly which addresses should travel through the tunnel, and make the server’s UDP endpoint reachable. Access to the server itself is simpler than reaching devices on its local network or routing all your internet traffic through it; those broader designs also need appropriate forwarding and firewall rules.

Choose what the VPN should let you reach

WireGuard transports IP packets between peers whose public keys are configured. It does not automatically expose every device on your home network or route all client traffic through the server. The WireGuard conceptual overview describes AllowedIPs as both routing information and a way to associate permitted source addresses with a peer.

As an Amazon Associate I earn from qualifying purchases.

Access goal Client-side AllowedIPs scope Additional network work
Reach services on the server The server’s tunnel address, or its tunnel subnet if you deliberately use one Allow the intended service through the server’s host firewall. Routing to the server’s tunnel address usually does not require forwarding traffic to another machine.
Reach selected devices on the server’s LAN The specific LAN subnet or addresses to reach Enable IP forwarding on the server and configure firewall rules and, if the topology requires it, NAT or a return route.
Send all client internet traffic through the server A default route, commonly written as 0.0.0.0/0 and, for IPv6, ::/0 Enable forwarding and configure firewall/NAT policy, internet egress, and client DNS behavior. Include IPv4 and IPv6 only if you intend to route both.

These are different designs, not interchangeable settings. A default route is much broader than a route for one server or LAN. Pick a private tunnel subnet that does not overlap networks you commonly use, such as a workplace or hotel network.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install WireGuard and create a separate key pair for each peer

Install the official WireGuard tools or application on the server and every client device. The project’s installation page lists supported platforms and installation options; consult it for current packages rather than relying on a version number that may have changed.

#1 Best Overall
GL.iNet GL-MT6000 Flint 2 Wi-Fi 6 Gaming Router Dual 2.5G Ports
  • Please update the firmware upon initial setup of the router, as it greatly enhances the device's performance and ensures a superior user experience.*** 【WiFi 6 Standard with ultra-low latency】Wi-Fi 6 speeds up to 6 Gbps to let you enjoy smoother 4K streaming, gaming, video calls and more, DDR4 1GB / eMMC 8GB
  • 【High Speed Gaming Router】Dominate with uninterrupted performance with the ultimate MT6000 gaming internet router, equipped with 8-stream Wi-Fi 6 technology, the Flint 2 delivers blazing speeds, ensuring a stable and high-speed connection during intense multiplayer battles.
  • 【Rapid OpenVPN & Wireguard speed】Wireguard VPN and OpenVPN speeds up to 900Mbps and 880Mbps respectively, giving you complete control over your gaming, streaming and working bandwidth. Actual speed may differ depending on internet service provider, network environment, VPN server location, VPN service provider, etc.
  • 【AdGuard Home Supported】Enabling the use of a DNS server for blocking unwanted tracking and offers a convenient web interface for filtering selected digital advertisements. Users can take full control of their online experience and enjoy a clutter-free browsing environment with ease.
  • 【Mass device connectivity】Experience enhanced online connectivity with our higher storage capacity, catering to over a hundred devices and fulfilling the requirements of DIY users seeking to install additional plugins. Enjoy stable and reliable connections, ensuring seamless performance and accommodating a wide range of digital needs.

Generate a distinct key pair for each peer and keep each private key on that peer. The official Quick Start shows this shell pattern on a system with the WireGuard command-line tools:

umask 077
wg genkey > server_private.key
wg pubkey < server_private.key > server_public.key

Repeat with different filenames for each client. umask 077 restricts access to newly created files for the account running the commands. Exchange public keys only; never send a private key to the other peer. Keep protected backups if you need recovery, and replace a peer’s configuration if its private key is exposed.

Plan tunnel addresses and AllowedIPs

Choose a tunnel address for each peer from the tunnel subnet, then decide which remote addresses each peer should send through the other. In a simple two-peer example, the server might use 10.7.0.1/24 and the client 10.7.0.2/24. These are illustrative addresses, not a required WireGuard range.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
GL.iNet GL-BE3600 Slate 7 Wi-Fi 7 Travel Router Touchscreen 2.5G
  • 【DUAL BAND WIFI 7 TRAVEL ROUTER】Products with US, UK, EU, AU Plug; Dual band network with wireless speed 688Mbps (2.4G)+2882Mbps (5G); Dual 2.5G Ethernet Ports (1x WAN and 1x LAN Port); USB 3.0 port.
  • 【NETWORK CONTROL WITH TOUCHSCREEN SIMPLICITY】Slate 7’s touchscreen interface lets you scan QR codes for quick Wi-Fi, monitor speed in real time, toggle VPN on/off, and switch providers directly on the display. Color-coded indicators provide instant network status updates for Ethernet, Tethering, Repeater, and Cellular modes, offering a seamless, user-friendly experience.
  • 【OpenWrt 23.05 FIRMWARE】The Slate 7 (GL-BE3600) is a high-performance Wi-Fi 7 travel router, built with OpenWrt 23.05 (Kernel 5.4.213) for maximum customization and advanced networking capabilities. With 512MB storage, total customization with open-source freedom and flexible installation of OpenWrt plugins.
  • 【VPN CLIENT & SERVER】OpenVPN and WireGuard are pre-installed, compatible with 30+ VPN service providers (active subscription required). Simply log in to your existing VPN account with our portable wifi device, and Slate 7 automatically encrypts all network traffic within the connected network. Max. VPN speed of 100 Mbps (OpenVPN); 540 Mbps (WireGuard). *Speed tests are conducted on a local network. Real-world speeds may differ depending on your network configuration.*
  • 【PERFECT PORTABLE WIFI ROUTER FOR TRAVEL】The Slate 7 is an ideal portable internet device perfect for international travel. With its mini size and travel-friendly features, the pocket Wi-Fi router is the perfect companion for travelers in need of a secure internet connectivity on the go in which includes hotels or cruise ships.

On the server, the client peer’s AllowedIPs normally includes that client’s tunnel address, such as 10.7.0.2/32. On the client, the server peer’s AllowedIPs should cover the server’s tunnel address and any additional networks you chose to access. Add the LAN subnet for selected-LAN access; use a default route only when you intend full-tunnel routing. The server and client entries do not have to be identical: each describes the addresses associated with that peer from its own side.

Configure the server and client

The following is a structure example for the wg-quick helper. Replace every placeholder with values from your own network; do not paste bracketed placeholders literally. Interface names and configuration paths can vary by operating system.

Server configuration

[Interface]
Address = 10.7.0.1/24
ListenPort = 51820
PrivateKey = <server private key>

[Peer]
PublicKey = <client public key>
AllowedIPs = 10.7.0.2/32

For multiple clients, add a separate [Peer] entry for each public key and its assigned tunnel address or addresses. Do not reuse one client’s private key across devices.

Rank #3
Sale
TP-Link Dual-Band AX3000 Wi-Fi 6 Wireless Gigabit Internet Router for Home | EasyMesh, VPN Clients & Server, HomeShield, OFDMA, MU-MIMO, USB 3.0, Secure by Design - Archer AX55
  • Next-Gen Gigabit Wi-Fi 6 Speeds: 2402 Mbps on 5 GHz and 574 Mbps on 2.4 GHz bands ensure smoother streaming and faster downloads; support VPN server and VPN client¹
  • A More Responsive Experience: Enjoy smooth gaming, video streaming, and live feeds simultaneously. OFDMA makes your Wi-Fi stronger by allowing multiple clients to share one band at the same time, cutting latency and jitter.²
  • Expanded Wi-Fi Coverage: 4 high-gain external antennas and Beamforming technology combine to extend strong, reliable, Wi-Fi throughout your home.
  • Improved Battery Life: Target Wake Time helps your devices to communicate efficiently while consuming less power.
  • Improved Cooling Design: No heat ups, no throttles. A larger heat sink and redefined case design cools the WiFi 6 system and enables your network to stay at top speeds in more versatile environments.

Client configuration

[Interface]
Address = 10.7.0.2/24
PrivateKey = <client private key>

[Peer]
PublicKey = <server public key>
Endpoint = <server public IP or DNS name>:51820
AllowedIPs = 10.7.0.1/32

Change the client’s AllowedIPs to include the chosen LAN subnet or default route if that is the intended access scope. The server’s peer entry needs the client’s public key; the client’s entry needs the server’s public key. The endpoint is the public-facing address and UDP port at which the client can reach the server.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

wg-quick can handle routine interface setup and teardown. On systems where it is installed and configured, a typical Linux command to bring up this example interface is wg-quick up wg0; use the relevant operating system’s instructions for starting it at boot and managing it safely.

Make the UDP endpoint reachable

WireGuard uses UDP. Allow the configured listen port—in this example, UDP port 51820—through the server’s host firewall. If the server is behind a home router, forward that UDP port from the router’s internet-facing interface to the server’s LAN address. A firewall allowance on the server alone cannot make an unreachable upstream endpoint accessible.

Rank #4
Sale
TP-Link ER605, Wired Gigabit VPN Router | Up to 3 WAN Ethernet Ports + 1 USB WAN, SPI Firewall SMB Router, Omada SDN Integrated, Load Balance, Lightning Protection
  • 【Five Gigabit Ports】1 Gigabit WAN Port plus 2 Gigabit WAN/LAN Ports plus 2 Gigabit LAN Port. Up to 3 WAN ports optimize bandwidth usage through one device.
  • 【One USB WAN Port】Mobile broadband via 4G/3G modem is supported for WAN backup by connecting to the USB port. For complete list of compatible 4G/3G modems, please visit TP-Link website.
  • 【Abundant Security Features】Advanced firewall policies, DoS defense, IP/MAC/URL filtering, speed test and more security functions protect your network and data.
  • 【Highly Secure VPN】Supports up to 20× LAN-to-LAN IPsec, 16× OpenVPN, 16× L2TP, and 16× PPTP VPN connections.
  • Security - SPI Firewall, VPN Pass through, FTP/H.323/PPTP/SIP/IPsec ALG, DoS Defence, Ping of Death and Local Management. Standards and Protocols IEEE 802.3, 802.3u, 802.3ab, IEEE 802.3x, IEEE 802.1q

If the public IP address changes, use a maintained DNS name or update the client’s endpoint address. The server also needs a reachable public endpoint: upstream carrier-grade NAT or another network arrangement that prevents inbound connections may require a different network solution. WireGuard supports endpoint roaming after authenticated traffic, but that does not remove the need for the initial endpoint to be reachable.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Enable forwarding only for traffic that must pass through the server

If clients need only services hosted on the VPN server itself, traffic addressed to the server’s tunnel IP may be handled without forwarding packets to other machines. For LAN access or full-tunnel internet access, the server must forward packets between the WireGuard interface and the destination network, and its firewall must permit the intended flows.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Return traffic matters too. The destination LAN must know how to send replies back to the tunnel subnet, either through a route to the VPN server or through an appropriate NAT rule. The correct forwarding, firewall, and NAT configuration depends on the server’s operating system, router, address plan, and access goal. Avoid applying generic copy-paste firewall commands without confirming those details.

Best Value
Sale
Roam 6 AX1500 Portable Wi-Fi 6 Travel Router Dual-Band USB C 3.0
  • 𝐑𝐨𝐚𝐦 𝟔 𝐀𝐗𝟏𝟓𝟎𝟎 𝐝𝐮𝐚𝐥-𝐛𝐚𝐧𝐝 𝐬𝐩𝐞𝐞𝐝𝐬 - Wi-Fi 6 Speeds up to 1,201 Mbps (5 GHz) and 300 Mbps (2.4 GHz) for up to 60 devices simultaneously. Actual Wi-Fi speeds vary based on source bandwidth, environment, distance to devices, and obstacles. ◇§
  • 𝐏𝐨𝐫𝐭𝐚𝐛𝐥𝐞 𝐚𝐧𝐝 𝐝𝐮𝐫𝐚𝐛𝐥𝐞 𝐝𝐞𝐬𝐢𝐠𝐧 - Roam 6 AX1500 is a pocket-sized travel router compactly designed for trips and adventures, featuring a 1 Gbps WAN/LAN port and a 1 Gbps LAN port for reliable wired connectivity.
  • 𝗦𝗲𝗰𝘂𝗿𝗲 𝗪𝗶-𝗙𝗶 𝗼𝗻-𝘁𝗵𝗲-𝗴𝗼 - Connects to public Wi-Fi and creates a private, secure network for all your devices. Supports multiple devices at once, ideal for hotels, Airbnbs, airports, and even home use. VPN connectivity enables secure remote work.
  • 𝐌𝐮𝐥𝐭𝐢𝐩𝐥𝐞 𝐰𝐚𝐲𝐬 𝐭𝐨 𝐜𝐨𝐧𝐧𝐞𝐜𝐭 - (1) Router Mode: Connects to public Wi-Fi, ISP, or phone (USB tethering). (2) AP/RE/Client Mode: Adds WiFi to wired setups, extends WiFi, or connects wired devices wirelessly.
  • 𝐎𝐮𝐫 𝐜𝐲𝐛𝐞𝐫𝐬𝐞𝐜𝐮𝐫𝐢𝐭𝐲 𝐜𝐨𝐦𝐦𝐢𝐭𝐦𝐞𝐧𝐭 - TP-Link is a signatory of the U.S. Cybersecurity and Infrastructure Security Agency’s (CISA) Secure-by-Design pledge. Advanced security is integrated into the device’s design, development, and ongoing maintenance.

Test the actual access you configured

  1. Bring up both peers. Start the server interface and connect from the client while it is on an outside network, such as cellular data rather than the same home Wi-Fi.
  2. Check the WireGuard status. Use the platform’s WireGuard status view or command-line tools such as wg show to inspect the interface and latest handshake. A recent handshake indicates that peers authenticated and communicated; it does not prove that routes, DNS, forwarding, or service firewalls are correct.
  3. Test the server itself. Connect to the server’s tunnel address and then test the specific service and port you intend to use. A responding tunnel address does not guarantee that an application is listening or permitted by the host firewall.
  4. For LAN access, test a selected LAN device. Try its LAN address and intended service. If the tunnel handshakes but the device cannot be reached, check client AllowedIPs, server forwarding and firewall policy, and the LAN’s return route or NAT behavior.
  5. For full-tunnel access, verify egress and DNS. Check that internet traffic exits through the server as intended and that DNS queries use the resolver you chose. Test IPv4 and IPv6 separately if both are meant to use the tunnel.

Use PersistentKeepalive only when the network needs it

WireGuard is quiet when idle. If a client behind NAT or a stateful firewall must remain reachable after it has sent no traffic for a while, a keepalive can refresh the network mapping. In that client peer’s configuration, add PersistentKeepalive = 25. WireGuard’s Quick Start describes 25 seconds as a sensible interval for a wide variety of firewalls, while noting that the option is disabled by default. Leave it out when idle reachability is not needed.

What WireGuard protects—and what remains your responsibility

WireGuard authenticates configured peers and encrypts traffic sent through the tunnel. Its protocol documentation describes components including Noise_IK, ChaCha20-Poly1305, Curve25519, BLAKE2s, SipHash24, and HKDF, along with periodic handshakes that rotate session keys and an optional preshared key mixed into the public-key cryptography. WireGuard states: “We require authentication in the first handshake message sent because it does not require allocating any state on the server for potentially unauthentic messages.” The explanation says an unauthorized client receives no response. See the project’s Protocol & Cryptography documentation.

A VPN does not secure the server by itself. Keep the operating system and exposed services maintained, protect private keys, limit each peer to the routes it needs, and retain a deliberate firewall policy. WireGuard leaves key distribution and configuration delivery outside its scope, so you are responsible for how peer configurations are created, shared, updated, and revoked.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.