Dynamic port selection for UI server