In this guide, we walk you through the steps so you can get Plex working with Mullvad.
First add a Port to be forwarded to your Mullvad account
- Log in to your Mullvad account on our website and then click on ADD PORT to add a port that you can use for Plex.
- Reconnect to a VPN server.
- In the Mullvad VPN app click on the Settings icon, preferences and then enable Local network sharing
Change Plex to listen on the added port
- Open Plex
- Click on Settings
- Click on Remote Access
- Enable remote access
- Check the "Manually specify public port" checkbox and enter the port number you were previously assigned and click on APPLY.
Add a firewall rule
- Click on the Windows key (Start)
- Type wf.msc and hit enter
- Click on Inbound Rules to select it
- Click on New Rule...
- Select Port and then Next
- Select TCP and Specific local ports and enter the port number you were assigned previously and then click Next
- Select Allow the connection and then Next
- Select both Private and public networks and click Next
- Enter a name, for instance "Plex port XXXXX" and then click on Finish
Add a forwarding rule
- Open a command prompt and run it as Administrator (Windows key type CMD and then click on "Run as Administrator")
- Write the following (on a single line) and then press enter (replace xxxxx with the port you were assigned) :
netsh interface portproxy add v4tov4 listenport=xxxxx listenaddress=0.0.0.0 connectport=32400 connectaddress=127.0.0.1
Start the forwarding rule
These steps will start the forwarding rule when you log in to Windows.
- Open notepad and paste the netsh command into it.
- Save the file as plex.bat
- Click on the Windows key and type taskschd.msc and then hit enter
- Click on Create basic task,
- Name it Plex and click on Next
- Select When I log on then Next.
- Select Start a program and click on Next.
- In the Program/script field click on browse and add the plex.bat that you previous created and click on Next
- Click on Finish
- Click on Task Scheduler library
- Double click on Plex
- Select Run with highest privileges found under General
- Save the changes by clicking on OK
- Enable forwarding by opening a terminal and running
sudo sysctl -w net.inet.ip.forwarding=1.
- To add a forwarding rule, run
echo "rdr pass inet proto tcp from any to any port xxxxx -> 127.0.0.1 port 32400" | sudo pfctl -ef -(replace xxxxx with the port you were assigned).
- To add a persistent redirect rule, run
echo "rdr pass inet proto tcp from any to any port xxxxx -> 127.0.0.1 port 32400" > /etc/pf.anchors/plex
(replace xxxxx with the port you were assigned).
Add the following to /private/etc/sysctl.conf
- To create a com.plex.pfctl.plist file, run
sudo nano /Library/LaunchDaemons/com.plex.pfctl.plist
- Paste the following into the file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE plist PUBLIC "-//Apple Computer/DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
- Then press ctrl + x and then Y and Enter to save.
- Add the following to /etc/pf.conf
load anchor "port32400" from "/etc/pf.anchors/plex"
Add a redirect rule by running the following code (replace xxxxx with the port you were assigned):
sudo iptables -t nat -I PREROUTING -p tcp --dport xxxxx -j REDIRECT --to 32400
Plex shows that it's accessible for less than a second (Windows)
Try to disable the firewall temporarily. In Windows: In the firewall settings right click on "Windows Defender Firewall" and select Properties, then set "Firewall state" to off on the three tabs Domain Profile, Private Profile and Public Profile. If that helps then turn it back on again and check that you added the rule correctly in the step above.
I am not sure if the netsh command worked (Windows)
Run the command
netsh interface portproxy show all to see the added rule. To remove the rule(s) run
netsh interface portproxy reset.
How to check that the port forwarding works? (Windows)
Read our port forwarding guide.
1. Run the command
netsh interface portproxy reset in an elevated command prompt.
2. Start iperf with the command
iperf3 -s -p xxxxx.
3. Go to our port check tool and check that the port is open.
Note: You can not connect to the SOCKS5 proxy's exit IP since SOCKS5 does not support port forwarding. Make sure that the proxy is disabled in the webbrowser.
Does it work with both OpenVPN and WireGuard?
Yes. If you use WireGuard then you have to add the port next to the WireGuard key that the app is using.
The Plex settings does not show the server settings and Remote Access (macOS)
Make sure that you have enabled Local network sharing in the Mullvad app. Try to quit Plex from the Plex icon in the macOS menu bar and start it again. Then click on the Plex icon and select "Preferences...".