Create a ufw application profile for plexmediaserver:
sudo nano /etc/ufw/applications.d/plexmediaserver
/etc/ufw/applications.d/plexmediaserver
[plexmediaserver]
title=Plex Media Server
description=All ports used by Plex, including DLNA
ports=32400/tcp|1900/udp|5353/udp|8324/tcp|32410/udp|32412:32414/udp|32469/tcp
Once you have defined your application file tell ufw to reload the application definitions with:
sudo ufw app update plexmediaserver
Use it with:
sudo ufw allow plexmediaserver
Ports from: https://support.plex.tv/articles/201543147-what-network-ports-do-i-need-to-allow-through-my-firewall/