"a bay, cove, inlet, or recess of a large body of water where vessels can load and unload and find shelter from storms; a harbor, whether natural or artificial," Old English port "a port, harbor, a place where there is a constant resort of vessels for the purpose of loading and unloading;" also "a town, market town, city," reinforced by Old French port "harbor, port; mountain pass." The Old English and Old French words both are from Latin portus "a port, harbor," figuratively "haven, place of refuge, asylum" (in Old Latin also "a house;" in Late Latin also "a warehouse"), originally "an entrance, a passage," akin to porta "a city gate, a gate, a door" (from PIE *prtu- "a going, a passage," suffixed form of root *per- (2) "to lead, pass over").
[I]in
law, a place where persons and merchandise are allowed to pass into and out of the realm and at which customs officers are stationed for the purpose of inspecting or appraising imported goods. In this sense a port may exist on the frontier, where the foreign communication is by land. [Century Dictionary]
The figurative sense "place, position, or condition of refuge" is attested in English from early 15c.; phrase any port in a storm, indicating "any refuge is welcomed in adversity," is by 1749. A port of call (1810) is one paid a scheduled visit by a vessel in the course of its voyage. The verb meaning "to carry or bring into a port" is by 1610s.