Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Plex Media Server UFW rule
[plexmediaserver]
title=Plex Media Server (Standard)
description=The Plex Media Server
ports=32400/tcp|5353/udp|32410:32414/udp

[plexmediaserver-minimal]
title=Plex Media Server (Minimal)
description=The Plex Media Server (Minimal)
ports=32400/tcp

[plexmediaserver-companion-pht]
title=Plex Media Server (Plex Companion-PHT)
description=The Plex Media Server controlling Plex Home Theater via Plex Companion
ports=3005/tcp

[plexmediaserver-companion-roku]
title=Plex Media Server (Plex Companion-Roku)
description=The Plex Media Server controlling Plex for Roku via Plex Companion
ports=8324/tcp

[plexmediaserver-companion]
title=Plex Media Server (Plex Companion)
description=The Plex Media Server controlling through Plex Companion
ports=3005/tcp|8324/tcp

[plexmediaserver-dlna]
title=Plex Media Server (DLNA)
description=The Plex Media Server (additional DLNA capability only)
ports=1900/udp|32469/tcp

[plexmediaserver-discovery-gdm]
title=Plex Media Server (GDM)
description=The Plex Media Server (GDM network discovery)
ports=32410:32414/udp

[plexmediaserver-discovery-bonjour]
title=Plex Media Server (Bonjour/Avahi)
description=The Plex Media Server (Bonjour/Avahi network discovery)
ports=5353/udp

[plexmediaserver-discovery]
title=Plex Media Server (Network discovery)
description=The Plex Media Server (Network discovery)
ports=5353/udp|32410:32414/udp

[plexmediaserver-all]
title=Plex Media Server (All)
description=The Plex Media Server (Standard + DLNA + Network discovery + Plex Companion)
ports=32400/tcp|3005/tcp|5353/udp|8324/tcp|32410:32414/udp|1900/udp|32469/tcp

Once you have defined your application file (plexmediaserver), put it in /etc/ufw/applications.d, then tell ufw to reload the application definitions with;

ufw app update plexmediaserver
ufw app info plexmediaserver

Use it with something like:

ufw allow from 192.168.1.10 to any app plexmediaserver
ufw allow from 192.168.1.0/24 to any app plexmediaserver
ufw allow plexmediaserver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.