The history of Moroccan ports is the history of Morocco itself, told from the sea. Long before the imperial cities rose inland, ships were already anchoring off this coast: Phoenician traders, Roman grain fleets, corsair galleys, Portuguese caravels and, in our own century, some of the largest container ships on earth. Every dynasty that ruled Morocco had to answer the same question — who controls the harbours?
All prices are in Moroccan dirhams (MAD), checked in November 2026, with dollar equivalents at roughly 10 MAD to $1. They are planning ranges, not promises. This guide follows the history of Moroccan ports from the first Phoenician anchorages to Tanger Med, which now moves more containers than any other port in Africa.
The short version: the sea made Morocco rich, the sea made it a target, and every ruler who mastered the harbours mastered the kingdom.
Period
What happened
Phoenician era, 1st millennium BCE
Trading posts at Tingis (Tangier), Lixus and Mogador island; purple dye and metals leave the coast
Roman era, 1st century BCE–5th century CE
Tingis becomes capital of Mauretania Tingitana; grain, oil and garum ship out
Corsair era, 17th century
The republic of Sale raids the Atlantic from the Bou Regreg
Portuguese era, 15th–16th centuries
Fortresses rise at Tangier, Asilah, El Jadida, Safi and Agadir
Alaouite era, 1760s
Sultan Sidi Mohammed ben Abdallah builds Mogador (Essaouira) as the kingdom’s planned port
International era, 1923–1956
Tangier becomes an international zone with its own port regime
Today
Tanger Med, opened 2007, is Africa’s and the Mediterranean’s largest container port
Phoenician Harbours and the First Atlantic Trade
The history of Moroccan ports begins with sailors who never intended to stay. Phoenician traders from the eastern Mediterranean worked their way along the North African coast in the first millennium BCE, and the Moroccan shore gave them what they wanted: sheltered anchorages, metals from the interior, and the murex shellfish whose glands produced the purple dye that dressed kings.
Three anchorages matter most. At the mouth of the Loukkos river stood Lixus, a Phoenician and then Roman port city whose ruins you can still walk today — read our account of Lixus, the Phoenician port of Morocco for the full story. At the northern tip, on the Strait of Gibraltar, the Phoenicians founded Tingis, the settlement that would become Tangier. And far to the south, on the small island that shelters the bay of Essaouira, they worked a purple-dye station.
None of these places was a city in the modern sense: seasonal stations, occupied when the sailing season allowed and left to the wind when it did not. Yet they fixed the pattern the whole history of Moroccan ports would follow — the coast was Morocco’s window on the wider world, and whoever held the anchorages held the trade. The Phoenicians traded for gold, ivory and metals that arrived by caravan from the far south — the same caravan roads that later fed Essaouira, the port the merchants of the 19th century called the port of Timbuktu (the name Mogador is traced to the Phoenician Migdol, small fortress — see the history of Mogador).
Tingis: Tangier as Rome’s Atlantic Gateway
Tangier is the oldest thread in the history of Moroccan ports, and also one of the hardest to date exactly. Britannica records the city as already existing as a Phoenician trading post in the middle of the first millennium BCE, while other accounts push its founding back to the 10th century BCE. The honest statement is that the port is older than its written record.
What is certain is what Rome made of it. After Carthage fell, Tingis passed to Rome: the general Sertorius captured it in 81 BCE, and in 38 BCE it was taken for Octavian, the future emperor Augustus. In 42 CE it became a free city and the capital of the Roman province of Mauretania Tingitana, under the name Tingis Colonia Julia Traducta. From its harbour, grain, olive oil and the fermented fish sauce called garum shipped out to feed the empire, and the city stayed commercially important even after the capital moved inland to Volubilis.
Five centuries of Roman rule ended in the 5th century with the Vandals, then the Byzantines in the 6th century, then the Arabs in the 7th: Uqba ibn Nafi reached Tangier in 682, Musa ibn Nusayr reconquered it in 707, and the Amazigh governor Tariq ibn Ziyad sailed from it in 711 to cross into Spain — the rock that still bears his name, Gibraltar, is Jabal Tariq. For a thousand years after that, Tangier’s port was the hinge between two continents, and the history of Moroccan ports kept returning to it.
The Corsair Century: Sale and the Atlantic Raiders
In the 17th century the history of Moroccan ports took a violent turn. At the mouth of the Bou Regreg river, between Rabat and Sale, exiled Andalusi families and European renegades built a corsair republic that lived by raiding Atlantic shipping. The Republic of Sale ran its own fleet, its own diplomacy and its own division of prizes, and for decades European admiralties treated it as a state in its own right.
The corsairs were not pirates in the simple sense. They operated under letters of marque, ransomed captives through organised markets, and raided as far as Ireland and Iceland. Their harbour was hard to attack — a shallow river mouth that stranded deep-draught warships — and their city was rich enough to buy its independence again and again. The sultans of Fez tolerated and taxed them, because the republic brought in wealth and kept European navies busy far from the imperial capitals.
The corsair century ended as the European navies grew too strong and the sultans reasserted control over the coast. But Sale left a permanent mark on the history of Moroccan ports: a Moroccan harbour could project power across an ocean, and the ports were too valuable to leave to themselves.
Portuguese Fortresses on the Atlantic Coast
Portugal came to Morocco by sea, and it stayed by building stone. In 1471 the Portuguese captured Tangier and Asilah in the same campaign, and over the next fifty years they ringed the Atlantic coast with fortresses: Mazagan, today’s El Jadida, in 1514; Safi; Azemmour in 1513; and Santa Cruz de la Mar Pequena at Agadir in 1505. Each was a walled gun platform with a harbour behind it.
The fortresses were also trading posts, and that is why they lasted as long as they did: wheat, wax, leather and sugar moved through them to Lisbon, and the Portuguese paid in cloth, arms and silver. But the balance was never stable. The Saadian sultans retook Agadir in 1541, and one by one the other strongholds fell or were abandoned. El Jadida held out longest: its Portuguese cistern and ramparts still stand, and our guide to the Portuguese fortress of El Jadida walks the walls the garrison defended.
The Portuguese century matters to the history of Moroccan ports because it changed what a port was. Before it, a Moroccan harbour was an anchorage with a town beside it. After it, a port was a fortified machine for controlling trade — walls, cannon, customs house and warehouse in one package. When the Alaouite sultans later built their own ports, they built them in that image.
Mogador: The Planned Port of Essaouira
No chapter in the history of Moroccan ports is stranger than Essaouira. The town you walk today was not grown, it was drawn: a planned port city laid out on a grid, with straight streets, star-shaped bastions and a harbour built to a single royal design. The sultan who ordered it, Sidi Mohammed ben Abdallah, aimed to concentrate Morocco’s overseas trade, and its customs revenue, under the crown’s direct control.
The exact founding year is not fully settled: UNESCO’s listing says the present town dates from 1765, while other references give 1769. The work certainly began in the 1760s: the sultan entrusted the French military engineer Theodore Cornut with the design, and Cornut laid out the kasbah and the merchant quarters on a checkerboard plan influenced by Vauban’s defences at Saint-Malo. The harbour fortifications were finished by the English renegade Ahmed El Alj in 1770.
The sultan then closed the southern coast to European traders and ordered the consuls at Safi, Agadir and Rabat to move to Mogador, where all southern trade would be concentrated. For the next eighty years the port boomed, as caravans arrived from Timbuktu with gold, ivory and ostrich feathers, and European ships carried them away with sugar, tea and cloth coming back. The Jewish merchants of the mellah — the tujjar al-sultan, the sultan’s merchants — ran much of that trade, and their story is part of our wider account of Morocco’s Jewish heritage. In 2001 UNESCO inscribed the medina as a World Heritage Site.
Tangier: From Sultan’s Port to International Zone
Tangier’s modern chapter in the history of Moroccan ports begins with its return to Moroccan rule. The Portuguese held it from 1471; in 1661 it passed to England as part of the dowry of Catherine of Braganza on her marriage to Charles II; and when the English left in 1684 they blew up the harbour works behind them. By the 19th century Tangier was again Morocco’s main window on Europe, the seat of the foreign legations and the port through which most travellers entered the country.
When the rest of Morocco became a French protectorate in 1912, Tangier was given a special status, and in 1923 it officially became an international zone, governed by an international commission. The port lived under its own regime for a generation: a free port and a city of spies and writers. Read the full story in our history of the Tangier International Zone.
Independence in 1956 ended the zone. The old city port was rebuilt in the 2000s as a marina for yachts, cruise ships and ferries, while the heavy cargo moved east to a new deep-water complex.
Casablanca: The Port That Built a City
Casablanca is the exception that proves the rule of the history of Moroccan ports: a city that the port created, rather than a port that served a city. In the 19th century Anfa was a small town with a modest anchorage. Under the French protectorate, the colonial administration dredged a great artificial harbour and made it the outlet for the phosphates of Khouribga and the wheat of the Chaouia plain.
By the 1930s Casablanca was Morocco’s largest city, built on docks, warehouses and the factories that fed on them — and the 1907 French bombardment of the city, after attacks on Europeans working on the port, opened the way to the protectorate. Our history of Morocco sets the port’s story inside the century that made modern Morocco.
Today Casablanca’s port still handles the bulk of Morocco’s general cargo, but the container traffic has largely moved north. The old port is a working place, not a monument: cranes, grain silos and the fishing fleet, with the Hassan II Mosque rising at its edge. Walk the Corniche at sunset and you can still read the city’s founding logic — the harbour first, everything else after.
Tanger Med and the Modern Atlantic
The newest chapter in the history of Moroccan ports is also the biggest. Tanger Med, a deep-water industrial port complex about 40 kilometres east of Tangier on the Strait of Gibraltar, opened its first container terminal in July 2007. The idea was simple: build a port where the world’s busiest shipping lanes pass within sight of the shore.
It worked beyond its planners’ hopes. The complex now has four container terminals with a handling capacity of 9 million TEU — the largest figure in the history of Moroccan ports — and in 2024 it handled 10,241,392 containers — more than any other port in Africa or the Mediterranean, ahead of Algeciras, Valencia and Piraeus. It connects to 180 ports in 70 countries, and around it has grown an industrial platform of more than a thousand companies exporting cars, aircraft parts and food.
What makes Tanger Med the fitting end of the history of Moroccan ports is that it repeats the oldest pattern with the newest tools. The Phoenicians came for a sheltered anchorage on a trade route; Tanger Med is a sheltered anchorage on the trade route between Asia and Europe. The ships are larger and the cargo moves in steel boxes instead of amphorae — but the strait is the same strait, and the coast is the same coast.
What the Old Ports Cost to Visit in 2026
The old ports are among the cheapest history in Morocco to walk through: most ramparts, harbours and fishing quays cost nothing at all. Ferries are the one real expense, priced by season and by operator, so treat these as planning ranges checked in November 2026 and confirm before you travel.
Visit
Typical cost, November 2026
Walking the Skala and ramparts, Essaouira
Free to 20 MAD ($0–$2)
Essaouira fishing-port boat trip, about 30 minutes
50–100 MAD ($5–$10) per person
Tangier Ville–Tarifa ferry, one way
300–600 MAD ($30–$60)
Tanger Med–Algeciras ferry, one way
250–450 MAD ($25–$45)
Tangier kasbah and port walk
Free
El Jadida Portuguese cistern entry
10–60 MAD ($1–$6)
Casablanca port and Corniche walk
Free
Frequently Asked Questions
Which is the oldest port in Morocco?
Tangier is the oldest port in the history of Moroccan ports: a Phoenician trading post by the middle of the first millennium BCE, with some accounts dating its founding to the 10th century BCE. Lixus, near Larache, is nearly as old.
Why was Essaouira built in the 1760s?
Sultan Sidi Mohammed ben Abdallah wanted a single royal port he could control, to concentrate Morocco’s Atlantic and trans-Saharan trade and its customs revenue. He closed the southern coast to European traders, moved the consuls to Mogador, and had Theodore Cornut design a planned, fortified town. The exact founding year is disputed: 1765 or 1769.
What were the corsairs of Sale?
In the 17th century, the history of Moroccan ports took a violent turn at Rabat and Sale, where a corsair republic raided Atlantic shipping under letters of marque, ransomed captives and ran its own diplomacy. Its shallow river mouth made it almost impossible for European warships to attack, and its wealth bought it decades of practical independence.
When did Tangier stop being an international zone?
The Tangier International Zone ran from 1923 until Moroccan independence in 1956, when the city was reintegrated into the kingdom. Its port returned to Moroccan administration, and the old city port was later rebuilt as a marina while cargo moved to Tanger Med.
Is Tanger Med really the largest port in Africa?
Yes — and it is the modern climax of the history of Moroccan ports. Tanger Med opened in 2007 and now has a handling capacity of 9 million TEU. In 2024 it handled more than 10.2 million containers, making it the busiest container port in Africa and in the Mediterranean, ahead of Algeciras, Valencia and Piraeus.
Can you visit the old ports today?
Yes, and most of the old ports in the history of Moroccan ports are free to walk: Essaouira’s Skala and fishing port, Tangier’s kasbah and harbour, El Jadida’s ramparts and cistern, and Casablanca’s Corniche are all open to visitors. The working container terminals are not open to the public, but their quays can be seen from the shore.
Conclusion
The history of Moroccan ports runs in one long line from the Phoenician anchorages to the container cranes of Tanger Med: the same coast, the same strait, the same trade, remade by each century. Tangier gave Morocco its oldest harbour, the corsairs of Sale gave it a century of sea power, the Portuguese gave it fortress ports, and Essaouira gave it a planned royal gateway that still works as a fishing port.
If you walk only one of them, walk Essaouira at sunset, when the fishing boats come in under the Skala’s cannon. And if you want to understand where the story goes next, look north to Tanger Med, where the history of Moroccan ports is still being written — in containers, at a rate of more than ten million a year. For the wider story of the country behind the history of Moroccan ports, start with our history of Morocco and the port cities in our Morocco Travel guides.