Insights

How to set up WireGuard on Unraid

Set up WireGuard in Unraid's VPN Manager, forward the matching UDP port, and verify access to your private service over cellular data.

Illustration of drive-bay tower with recessed wire arch.
On this page

WireGuard is built into Unraid: open Settings > VPN Manager, name your tunnel and generate its keys. Set the public endpoint, forward its User Datagram Protocol (UDP) port to Unraid and activate the tunnel, then add a peer and import its profile into the WireGuard app. Test the service you want to reach from outside your home Wi-Fi.

In short:

  • Match access to need. Choose server access for Unraid or home network access for other devices.
  • Match the ports. Forward the endpoint's UDP port to Unraid.
  • Test over cellular. Confirm both a fresh handshake and access to your intended service.

Create the tunnel and choose what it can reach

  1. Create the tunnel in Unraid. Open Settings > VPN Manager, give the tunnel a name such as Home access and select Generate Keypair.
  2. Choose the access mode you'll assign to your peer. A peer is the phone or computer you'll connect. Pick the mode based on what that device needs to reach:
    • Remote access to server for the Unraid web interface or services on Unraid, such as shares and containers.
    • Remote access to LAN for other devices on your home local area network (LAN).
    • Remote tunneled access if you want the remote device's internet traffic to exit through home. You don't need this mode just to open a private service.

Importing a commercial provider's profile into Unraid sets up an outgoing WireGuard connection. That's different from letting your phone connect back to Unraid.

Make the WireGuard port reachable

  1. Set the public endpoint. In Local endpoint, use your public Internet Protocol (IP) address. If it changes, use a dynamic Domain Name System (DDNS) hostname that points to your current public IP. Keep the default port, 51820, unless it conflicts with another service, then select Apply.

  2. Forward only the WireGuard port. Before changing router settings, make sure you're authorized to do so and can reach the router locally to undo the change. If your router supports Universal Plug and Play (UPnP) and it's enabled, Unraid can create the rule when you enable UPnP in Settings > Management Access.

    If automatic forwarding isn't in use, forward the UDP port shown in Local endpoint to your Unraid server's private IP address. Use the same port for the external and internal settings. Don't forward the Unraid web interface.

  3. Start the tunnel. Turn on Active in Unraid's VPN Manager. Enable Autostart if you want the tunnel to start when Unraid boots.

If your provider shares a public IP address across customers using carrier-grade network address translation (CGNAT), your router's rule alone won't open the port through the provider's network. Ask your provider whether you can get a public IP address that accepts inbound traffic.

Connect your phone or computer

  1. Add one trusted device. In Unraid's VPN Manager, select Add Peer, name the device and choose the access mode you picked. Select Generate Keypair for the peer, add a preshared key if you want one, then select Apply.
  2. Import the saved profile. In Unraid, select the eye icon beside the peer to open its configuration. On your phone, choose Create from QR code in the WireGuard app, scan the displayed code and name the connection. For a computer, download the configuration from the same view, transfer it securely, then unzip and import it into the WireGuard app.
  3. Keep the profile private. Protect the private key, QR code and configuration file. Use the profile only on the device it was created for and keep it out of screenshots, support posts and untrusted tools.

Test the tunnel away from home

  1. Switch the phone to cellular data. Turn off Wi-Fi and enable the phone's WireGuard tunnel. Active means the tunnel has started, not that the two devices have connected.
  2. Open the service by its private IP address. Start with the Unraid web interface at its known private address. If you chose Remote access to LAN for another home service, try that service at its private address too.
  3. Check for a fresh handshake after the access attempt. A handshake is the exchange that establishes the connection between your phone and Unraid. The check passes when you see a fresh handshake and the intended service opens while the phone is still on cellular data.

If there's no fresh handshake, check that the tunnel is active on both devices. Then check that the endpoint points to your current public IP, the forwarding rule matches the endpoint's UDP port and the phone has the latest saved profile. If the handshake is fresh but the service won't open, check what the peer can reach next.

When the tunnel connects but the service won't open

Try the service's known private IP address before changing name or routing settings. If the address works but the name doesn't, check whether the peer's Domain Name System (DNS) resolver knows that private name. To change the resolver in Unraid, open Settings > VPN Manager, switch to Advanced and enter its IP address in Peer DNS Server. Save the change and update the client profile.

If Unraid opens but another home device doesn't, check that the peer uses Remote access to LAN. If it fails only on another Wi-Fi network, check whether that network uses the same private address range as your home network. Overlapping ranges can send traffic to the wrong network.

Keep the default Use NAT setting for a typical home network. Network address translation (NAT) changes the source address that home devices see. Some Docker containers with custom IP addresses or virtual machines with strict network requirements need Unraid's advanced setup instead: turn off NAT and add a return route for the WireGuard network through Unraid. For Docker custom networks, that setup also enables Host access to custom networks in Unraid's Docker settings.

Where doxx.net fits. doxx.net runs a separate private network on its own hardware, with its own IP address space and DNS root. If you also want to connect a device to that network, create a doxx.net account, download the app and connect your device.

Ask an AI assistant

Share this article

Private Everywhere

Stop giving the internet everything

Keep your browsing, messages, files, and agents private.