Manually-specified port on VPS

Server Version#: 1.40.2.8395
Player Version#: 4.129.1 (web)

I run my Plex server on an Ubuntu VPS, hosted in the cloud.

When I try to change to a manually-specified port, it is unable to connect. The port in question is open on the VPS’s firewall (ufw).

There is no other firewall involved: my VPS has a public IP and connects directly to the Internet.

I have tried a few different ports, but no joy.

The reason for doing this is that my work refuse to allow outbound connections on port 32400. If I could change the port to a more commonly-allowed port (such as 43, 80, or 8080), I might be able to access Plex at work. (My work have no problem with me using Plex, but they refuse to open ports on their firewall for me.)

You will need something to re-map the port - the equivalent of a port forward statement in a router.

Manually specifying a different port does not change the port used by Plex Media Server. It always uses TCP/32400 to communicate with clients.

When you pick a different port, Plex expects that something (router, firewall, etc.) is remapping the advertised port to 32400.

A quick Google search for “Ubuntu remap port” returned several possibilities.

Here’s one that uses iptables: https://www.cyberciti.biz/faq/linux-port-redirection-with-iptables/

It has an example that redirects inbound traffic on port 80 to port 8123. You could try modifying that as needed to redirect the desired inbound port to 32400.

Thank you for this. I solved it by:

Add this to the top of /etc/ufw/before.rules:

*nat
:PREROUTING ACCEPT [0:0]
-A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 32400
COMMIT

Uncomment in /etc/sysctl.conf:

net.ipv4.ip_forward=1

and

net.ipv6.conf.all.forwarding=1

Manually specify remote access on port 443.

Now I just need to test it when I get back to work…

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.