When using plugins, usually the developer (mainly votdev and ryecoarron nowadays) of the plugin takes care that the ports which are used by the plugin are not used by another service or application. But as docker becomes more and more popular the user has to take care of selecting the correct port.
To select the right exposed port in docker for me two information are most important:
- Which ports are used by standard from other applications. For this lists exist in the internet like this one: https://en.wikipedia.org/wiki/…_TCP_and_UDP_port_numbers
If you are not using the mentioned application, you are fine to use it on your server. This is more likely for the ports in the range 49152–65535.
- Which ports are currently use on my system (as most of the application which are mentioned above are not installed on my system). For this you can use several commands. Examples are shown here: https://www.cyberciti.biz/faq/…f-port-is-in-use-command/
One example: lsof -i -P -n | grep LISTEN