Allowing Plex remote connections through iptables (ubuntu)

After forwarding 32400 (or whatever port you wish to use) through your router, or enabling UPnP, you still need to allow incoming connections on your Linux server to access Plex from outside your local network.

Luckily I found this helpful site that gave a quick list of what ports need to be allowed through. Copy and paste the following commands and you should be good to go.

sudo iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 32400 -j ACCEPT
sudo iptables -A INPUT -m state --state NEW -m udp -p udp --dport 32400 -j ACCEPT
sudo iptables -A INPUT -m state --state NEW -m udp -p udp --dport 32410 -j ACCEPT
sudo iptables -A INPUT -m state --state NEW -m udp -p udp --dport 32412 -j ACCEPT
sudo iptables -A INPUT -m state --state NEW -m udp -p udp --dport 32414 -j ACCEPT
sudo /sbin/iptables-save

*Make sure you have “Manually specify public port” checked in your Plex settings*
Your Plex settings should look like this:

plex-iptables