
Ports usually have specialised functions: some tend to cater mainly for passenger ferries and cruise ships some specialise in container traffic or general cargo and some ports play an important military role for their nation's navy.

Modern ports will have specialised cargo-handling equipment, such as gantry cranes, reach stackers and forklift trucks. Other businesses such as regional distribution centres, warehouses and freight-forwarders, canneries and other processing facilities find it advantageous to be located within a port or nearby. Deep water ports such as Milford Haven are less common, but can handle larger ships with a greater draft, such as super tankers, Post-Panamax vessels and large container ships. Ports are often on estuaries, where the water may be shallow and may need regular dredging. Ideally, a port will grant easy navigation to ships, and will give shelter from wind and waves. Successful ports are located to optimize access to an active hinterland, such as the London Gateway. Whereas early ports tended to be just simple harbours, modern ports tend to be multimodal distribution hubs, with transport links using sea, river, canal, road, rail and air routes. Rye, East Sussex, was an important English port in the Middle Ages, but the coastline changed and it is now 2 miles (3.2 km) from the sea, while the ports of Ravenspurn and Dunwich have been lost to coastal erosion. Even in more recent times, ports sometimes fall out of use. Many of these ancient sites no longer exist or function as modern ports. Famous African trade ports such as Mombasa, Zanzibar, Mogadishu and Kilwa were known to Chinese sailors such as Zheng He and medieval Islamic historians such as the Berber Islamic voyager Abu Abdullah ibn Battuta. They were described by Greek historians as "metropolises". Post-classical Swahili kingdoms are known to have had trade port islands and trade routes with the Islamic world and Asia.

In Japan, during the Edo period, the island of Dejima was the only port open for trade with Europe and received only a single Dutch ship per year, whereas Osaka was the largest domestic port and the main trade hub for rice. Ostia Antica was the port of ancient Rome with Portus established by Claudius and enlarged by Trajan to supplement the nearby port of Ostia. In ancient India from 3700 BCE, Lothal was a prominent city of the Indus valley civilisation, located in the Bhal region of the modern state of Gujarāt. In ancient Greece, Athens' port of Piraeus was the base for the Athenian fleet which played a crucial role in the Battle of Salamis against the Persians in 480 BCE. Other ancient ports include Guangzhou during Qin Dynasty China and Canopus, the principal Egyptian port for Greek trade before the foundation of Alexandria. Along with the finding of harbor structures, ancient anchors have also been found. One of the world's oldest known artificial harbors is at Wadi al-Jarf on the Red Sea. Wherever ancient civilisations engaged in maritime trade, they tended to develop sea ports. Internationally, global ports are beginning to identify ways to improve coastal management practices and integrate climate change adaptation practices into their construction. Ports are heavily affected by changing environmental factors caused by climate change as most port infrastructure is extremely vulnerable to sea level rise and coastal flooding. Ports can have a wide environmental impact on local ecologies and waterways, most importantly water quality, which can be caused by dredging, spills and other pollution.

Nevertheless, countless smaller ports do exist that may only serve their local tourism or fishing industries. As of 2020, the busiest passenger port in Europe is the Port of Helsinki in Finland. Today by far the greatest growth in port development is in Asia, the continent with some of the world's largest and busiest ports, such as Singapore and the Chinese ports of Shanghai and Ningbo-Zhoushan. For this reason, ports are also often densely populated settlements that provide the labor for processing and handling goods and related services for the ports. Ports are extremely important to the global economy 70% of global merchandise trade by value passes through a port. Because of their roles as ports of entry for immigrants as well as soldiers in wartime, many port cities have experienced dramatic multi-ethnic and multicultural changes throughout their histories. Although usually situated on a sea coast or estuary, ports can also be found far inland, such as Hamburg, Manchester and Duluth these access the sea via rivers or canals. A port is a maritime facility comprising one or more wharves or loading areas, where ships load and discharge cargo and passengers.
