Ubuntu 12.04 UFW

Hello,

I have plex running on Ubuntu. Which ports do I need to open on the UFW to get plex working and get access to a windows cifs share?

 

I tried already port 80,32400, 445, 443, 137, 389 and 139.

 

When I turn ufw off plex is working perfect, but I'd like some extra protection.

 

Can you help me.

Hello.

Here is my ufw configuration at the moment. Please note that there is a lot more services running on this server than just plex.

To                       Action      From
----                       ------      --
80                         ALLOW       Anywhere
443                        ALLOW       Anywhere
25                         ALLOW       Anywhere
993                        ALLOW       Anywhere
22                         ALLOW       192.168.1.0/24
3306                       ALLOW       192.168.1.0/24
445                        ALLOW       192.168.1.0/24
548                        ALLOW       192.168.1.0/24
587                        ALLOW       Anywhere
143                        ALLOW       Anywhere
135                        ALLOW       192.168.1.0/24
137                        ALLOW       192.168.1.0/24
138                        ALLOW       192.168.1.0/24
139                        ALLOW       192.168.1.0/24
42000                      ALLOW       192.168.1.0/24
42001                      ALLOW       192.168.1.0/24
42002                      ALLOW       192.168.1.0/24
42010                      ALLOW       192.168.1.0/24
2049                       ALLOW       192.168.1.0/24
111                        ALLOW       192.168.1.0/24
4679                       ALLOW       192.168.1.0/24
32443                      ALLOW       192.168.1.0/24
389                        ALLOW       192.168.1.0/24
514                        ALLOW       192.168.1.0/24
9000                       ALLOW       192.168.1.0/24
32400                      ALLOW       192.168.1.0/24
192.168.1.81 9090          ALLOW       192.168.1.0/24
192.168.1.81 32469         ALLOW       192.168.1.0/24
192.168.1.81 22            ALLOW       Anywhere

You can make a app profile for PMS by putting this file in /etc/ufw/applications.d/

Then

ufw allow PlexMediaServer

ufw allow Samba

[PlexMediaServer]
title=Plex Media Server
description=This opens up PlexMediaServer for http (32400), upnp, and autodiscovery.
ports=32469/tcp,32413/udp,1900/udp,32400/tcp,32412/udp,32410/udp,32414/udp

Thanks, that helped me as well. One note: on my system the syntax was slightly different:
[PlexMediaServer] title=Plex Media Server description=This opens up PlexMediaServer for http (32400), upnp, and autodiscovery. ports=32469/tcp|32413/udp|1900/udp|32400/tcp|32412/udp|32410/udp|32414/udp

@msylw said:
Thanks, that helped me as well. One note: on my system the syntax was slightly different:
[PlexMediaServer] title=Plex Media Server description=This opens up PlexMediaServer for http (32400), upnp, and autodiscovery. ports=32469/tcp|32413/udp|1900/udp|32400/tcp|32412/udp|32410/udp|32414/udp

This worked for me on Ubuntu 15.10, thanks

Added the above snippet to a new file called “plexmediaserver” in /etc/ufw/applications.d/ then did “sudo ufw allow plexmediaserver” and it all seems to be working.

Request for clarification please.

Ubuntu 16 syntax
Ubuntu 17 syntax

If the syntax is different based on desktop environment (for the GUI), please share?

Thanks.

@msylw said:
Thanks, that helped me as well. One note: on my system the syntax was slightly different:
[PlexMediaServer] title=Plex Media Server description=This opens up PlexMediaServer for http (32400), upnp, and autodiscovery. ports=32469/tcp|32413/udp|1900/udp|32400/tcp|32412/udp|32410/udp|32414/udp

I had to create the profile file using this syntax as well. Then Plex worked fine when ufw was enabled on the server. Thanks everyone.

This worked for me on Ubuntu 18.04 server. Thanks!

root@system: cat PlexMediaServer
[PlexMediaServer]
title=Plex Media Server
description=This opens up PlexMediaServer for http (32400), upnp, and autodiscovery.
ports=32469/tcp|32413/udp|1900/udp|32400/tcp|32412/udp|32410/udp|32414/udp
root@system: ufw app list
Available applications:
  OpenSSH
  PlexMediaServer
root@system: ufw status
Status: active

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere
PlexMediaServer            ALLOW       Anywhere
OpenSSH (v6)               ALLOW       Anywhere (v6)
PlexMediaServer (v6)       ALLOW       Anywhere (v6)