When selecting the host port, there is a "generate random ports" button option. Clicking it will automatically generate a port value that is not used by other containers for the host port mapped by the current container.
Because every time I add a new container, picking an unused port really makes me entangled.