Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Setup VPS + Unraid + Wireguard + Plex

Featured Replies

Hey folks,

 

I already tried my luck on reddit but without any success.

As the title suggests, I´m trying to connect my unraid to a vps with wireguard. What am I trying to achieve? Since I am behind a cgnat, I would like to share plex via the static IP of the vps.

 

I managed to setup wireguard on the vps, open the port with ufw and got unraid to connect to the vps. However what I couldn´t achieve was to connect to plex using the vps. Any ideas? I prefer to use "native" wireguard instead of tailscale.

 

yaml wg-easy on vps:

version: "3.8"

services:

wg-easy:

environment:

- WG_HOST=1*****

- WG_POST_UP=iptables -t nat -A PREROUTING -p tcp --dport 32400 -j DNAT --to-destination 10.8.0.2

- WG_POST_DOWN=iptables -t nat -A PREROUTING -p tcp --dport 32400 -j DNAT --to-destination 10.8.0.2

image: ghcr.io/wg-easy/wg-easy

container_name: wg-easy

volumes:

- $HOME/docker/volumes/wg:/etc/wireguard

ports:

- "51820:51820/udp"

- "32400:32400/tcp"

# - "51821:51821/tcp"

restart: unless-stopped

cap_add:

- NET_ADMIN

- NET_RAW

- SYS_MODULE

sysctls:

- net.ipv4.ip_forward=1

- net.ipv4.conf.all.src_valid_mark=1

 

  • Community Expert

? hyper v on the vps running windows running a VM for unraid?

Need more clarfication / context to assist.


setting up docker Plex - fairly straight forward...

setting up VPN - wiregurad / tailscale depends on where its at
VPS with who on what platform?is unriad the vps system?


or are you runnign unriad to act as a VPS to share VMs?

 

  • Community Expert

as this sounds more like the vps system you are running needs configuration to connect to the wirguard VPN to access plex server.

  • Author
19 hours ago, bmartino1 said:

? hyper v on the vps running windows running a VM for unraid?

Need more clarfication / context to assist.


setting up docker Plex - fairly straight forward...

setting up VPN - wiregurad / tailscale depends on where its at
VPS with who on what platform?is unriad the vps system?


or are you runnign unriad to act as a VPS to share VMs?

 

 

Sorry I will get more into details, to clear things up. First, thanks for your reply and help. 🙏

 

I´m running a vps with debian. The vps is rented and located in a data centre. My unraid is located in my house and behind a cgnat.

So my idea is I will host a wireguard server (wg-easy) via docker on the vps and connect unraid to it. So my vps is the wireguard server. I mounted the neccessary ports for plex and unraid for the container. So the idea is to proxy the plex docker container on unraid trough wireguard/vps.

Unraid was also able to connect to the vps, what I couln´t achieve was to proxy plex traffic trough wireguard. Unfortunately I´ve no clue if I messed on the vps or unraid part of it.

Edited by MCKraemer

  • Community Expert

Thank You. I'm goin to map it out and atempt to assit. You may have issues at the VPS networking level and /or your ISP cgnat level.


Lets review teh VPS Debain instance first:

Host VPS Website interaction/Interface > ?Host ISP > ?unknown networking/firewall > VPS installed Wireguard instant (Yaml above) > VPS Debian System

 

Questions to clarify:

?Debian 12 bookworm assumed. Gui no gui? is it ssh capabel to the world? can you putty ssh into it at its vps host IP?

 

VPS Wireguard Broakge Server 
 

CGNAT Home ISP > ?Modem > Router? Unkown networking / firewall > Wireguard VPN Connection > ?NPM Proxy Server? > Unraid > Plex

 

Unraid supports a wireguard vpn conection server/client.

You may have a misconfiguration on both ends.
?Can you run a temp applicaiton like nginx and verify that the VPS is hostin gand that you are able to access nginx as an example.
?Can you ssh its public IP to access it
?Can you wiregurad conect to teh VPS and see the nginx/ssh via wireguard 

If yes to the above then wireguard / VPS is wokring as it should time to check unriad configurations...

 

 

Unriad can get weird when using dockers to act as middle networking clients.
 

Review:

https://unraid.net/blog/wireguard-on-unraid

 

 

 

 

 

https://youtu.be/yG5TqPtjYjM?si=3urlGWWl3ubzbKtG

 

Some Unriad settings to double check:

Unraid WebUI > Settings > Docker > Adsvance Toggle:

image.png.66441959563fbed86fb79a2789d1dca1.png

Make sure you have host access to custom networks enabled.

 

IDK you level and knowledge this is what I can share atm to assist.

  • Author

I will do my best to provide all necessary data. 

 

VPS - Debian 12:
No gui, access via ssh, I can putty into it via it's ip.

Unraid > CGNAT Home ISP > AVM FritzBox (Router) > VPS > UFW > Wireguard Docker (working)
Mobile > CGNAT Home ISP > AVM FritzBox (Router) > VPS > UFW > Wireguard Docker > Unraid (not working)
Mobile > CGNAT Home ISP > AVM FritzBox (Router) > VPS > UFW > Wireguard Docker > VPS internal wireguard ip (working)

 

I can open the Unraid dashboard with my phone while connected to the Wireguard VPN and reach it via its Wireguard IP.

 

Now I am trying to access it without connecting my phone to the vpn. I have port 32400 in the yaml. Plex uses this port, I also added to forward this port to the nas:
- WG_POST_UP=iptables -t nat -A PREROUTING -p tcp --dport 32400 -j DNAT --to-destination "unraid internal wireguard ip".
- WG_POST_DOWN=iptables -t nat -A PREROUTING -p tcp --dport 32400 -j DNAT --to-destination "unraid internal wireguard ip".

 

This doesn't work, port 32400 is allowed in uwf.

Edited by MCKraemer

  • Author
15 hours ago, MCKraemer said:

I will do my best to provide all necessary data. 

 

VPS - Debian 12:
No gui, access via ssh, I can putty into it via it's ip.

Unraid > CGNAT Home ISP > AVM FritzBox (Router) > VPS > UFW > Wireguard Docker (working)
Mobile > CGNAT Home ISP > AVM FritzBox (Router) > VPS > UFW > Wireguard Docker > Unraid (not working)
Mobile > CGNAT Home ISP > AVM FritzBox (Router) > VPS > UFW > Wireguard Docker > VPS internal wireguard ip (working)

 

I can open the Unraid dashboard with my phone while connected to the Wireguard VPN and reach it via its Wireguard IP.

 

Now I am trying to access it without connecting my phone to the vpn. I have port 32400 in the yaml. Plex uses this port, I also added to forward this port to the nas:
- WG_POST_UP=iptables -t nat -A PREROUTING -p tcp --dport 32400 -j DNAT --to-destination "unraid internal wireguard ip".
- WG_POST_DOWN=iptables -t nat -A PREROUTING -p tcp --dport 32400 -j DNAT --to-destination "unraid internal wireguard ip".

 

This doesn't work, port 32400 is allowed in uwf.

 

 

Correction:
Case 2: Mobile > CGNAT Home ISP > AVM FritzBox (Router) > VPS > UFW > Wireguard Docker > Unraid (is working)

 

What I want to achieve:

Mobile/Computer/Tablet (not connected to wireguard) > CGNAT Home ISP > AVM FritzBox (Router) > VPS:32400 > UFW > Mapped Port to Wireguard Docker > Unraid > Plex

Edited by MCKraemer

  • Community Expert

is the vps a system outside your home or are you refeing to vps as a VM as a seperate machine in you home?

cgnat and FritzBox area known issues especial using vpn wireguard stuff

  • Author
55 minutes ago, bmartino1 said:

is the vps a system outside your home or are you refeing to vps as a VM as a seperate machine in you home?

cgnat and FritzBox area known issues especial using vpn wireguard stuff

Outside the house, KVM VPS located in a data centre. I'm pretty sure, it's my port forwarding. The connection to wireguard is working, Unraid is connected to wireguard. I can ping Unraid and open Plex via it's wireguard IP.

 

So the wireguard tunnel shouldn't be the issue. It must be the forwarding.

  • Community Expert

ok, based on this information and the fact that you can ssh into the VPS from your home tells me that the vps and wiregurad should be working corectly on teh VPS.

So lets focus on unraid and some settings.

do you have host access to custom enabled under docker?
ipvlan or macvlan?


what is your unraid networking:
do you have br0, bond0, eth0 ? on ly 1 nick in unraid?

review:

 

https://docs.unraid.net/unraid-os/manual/security/vpn/#wireguard

 

As you seem to be fighting your ISP and portforwarding. Do to fritzbox and some other known issues. I would recomend looking into using tailscale.

https://docs.unraid.net/unraid-os/manual/security/tailscale/
with unraid v7 there is a plugin.

There is a docker. And others have installed debain in a LXC and run nginx proxy manger and tailscale

 

 

as hosting and connecting to wiregruad will not work due to your ISP and CGNAT as you would need a brokerage server to assist with dynmaic ip and ports open at your Home ISP

  • Author
17 hours ago, bmartino1 said:

ok, based on this information and the fact that you can ssh into the VPS from your home tells me that the vps and wiregurad should be working corectly on teh VPS.

So lets focus on unraid and some settings.

do you have host access to custom enabled under docker?
ipvlan or macvlan?


what is your unraid networking:
do you have br0, bond0, eth0 ? on ly 1 nick in unraid?

review:

 

https://docs.unraid.net/unraid-os/manual/security/vpn/#wireguard

 

As you seem to be fighting your ISP and portforwarding. Do to fritzbox and some other known issues. I would recomend looking into using tailscale.

https://docs.unraid.net/unraid-os/manual/security/tailscale/
with unraid v7 there is a plugin.

There is a docker. And others have installed debain in a LXC and run nginx proxy manger and tailscale

 

 

as hosting and connecting to wiregruad will not work due to your ISP and CGNAT as you would need a brokerage server to assist with dynmaic ip and ports open at your Home ISP

Hi, 

 

can you explain why my Unraid is the issue?

 

You might misunderstood me, Unraid is not the wireguard server, it's just a client. Further it is successfully connected to the vps/wireguard server. I can ping Unraid via wireguard and open Plex via wireguard.

 

I can't open Plex when I hit the wireguard server on port 32400. Which should forward to Unraid in wireguard.

 

This might change something? 

 

Thanks for your help. 🙏🏻 

 

Network setting is ipvlan. br0 and eth0

Edited by MCKraemer

  • Community Expert

unraid itself is not the problem its the isp fritzbox cgnat. more on how cgnat works and what ports are open and avable to form a connection.
unraids client is not making a stable connection to the WireGuard VPN. Thus unraid is the issue.

  • Community Expert

due to cgnat. I would recommend a switch to tailscale.
 

 

  • Author
On 2/26/2025 at 12:56 AM, bmartino1 said:

due to cgnat. I would recommend a switch to tailscale.
 

 

I will give it a try, thanks: 🙂

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.