Marrakech Ramparts & Gates: Visitor Guide

Toits et remparts ocre du quartier de la Kasbah à Marrakech

The Marrakech ramparts rank among the most iconic landmarks of the “red city”: nearly 19 kilometres of ochre-coloured rammed-earth walls, bristling with square towers, that have encircled the old medina since the 12th century. Pierced by several monumental gates — the famous bab — they alone tell the story of the city’s Almoravid and Almohad past. If you want a quick answer: yes, walking (or riding by horse-drawn carriage) around the ramparts is one of the finest ways to discover Marrakech, especially at sunset when the raw earth blazes with pink and orange reflections.

In this complete guide, you’ll learn about the history of these walls of Marrakech, why the city is nicknamed “the ochre city”, a detailed rundown of the great gates of Marrakech not to be missed — starting with the superb Bab Agnaou — and all our practical tips: how to make the circuit of the fortifications, where to find the best viewpoints, how much time to allow, and what to see near each gate. An itinerary that is both historical and photogenic, accessible to every traveller.

Towers of the Marrakech ramparts
Watchtowers punctuate the 19 km of walls.

In brief: the essentials on the Marrakech ramparts

  • Total length: about 19 km of walls encircling the medina.
  • Construction period: 12th century, under the Almoravid dynasty (around 1126, under Ali ibn Yusuf).
  • Material: pisé (rammed raw earth) of a pinkish-ochre hue, hence the nickname “red city”.
  • Height: up to 6 to 9 metres in places, with numerous watchtowers.
  • Main gates: Bab Agnaou, Bab Doukkala, Bab el-Khemis, Bab Debbagh, Bab er-Robb, Bab Aylen…
  • Best time: late afternoon and sunset, when the low light magnifies the ochre earth.
  • Making the circuit: on foot (several hours) or by horse-drawn carriage (indicative price, see below).
  • Access: free, outdoors; the medina is a UNESCO World Heritage Site.

The Marrakech ramparts: history, rammed earth and dimensions

The story of the Marrakech ramparts begins in the 12th century. The city had been founded around 1070 by the Almoravids, a Berber dynasty from the Sahara, who made it the capital of their vast empire stretching from southern Morocco to Andalusia. At first, Marrakech was little more than a large camp organised around a fortress and wells. It was Sultan Ali ibn Yusuf who, around 1126, decided to surround his capital with a genuine defensive enclosure to protect it from outside threats, notably the Almohad rivals who were rising in power in the High Atlas.

These walls of Marrakech were built in pisé, a construction technique using raw earth rammed and compacted within wooden formwork. Local clay soil is mixed with a little lime, sand and sometimes straw, then tamped down layer after layer between shuttering boards. This economical process, perfectly suited to the semi-arid climate, produces thick walls that stay cool in summer and retain warmth in winter. It is precisely the natural colour of this earth — a pinkish ochre characteristic of the region’s soil — that gives the ramparts, and by extension the whole city, their famous reddish-orange tone.

Today, the enclosure extends for about 19 kilometres around the historic medina. The walls reach 6 to 9 metres high in places and are punctuated by numerous square towers, the bordj, which once served as lookout posts and reinforced the defences. Over the centuries, the various dynasties — Almohads, Saadians, Alaouites — maintained, repaired and sometimes expanded these fortifications, but the Almoravid framework remains. As pisé is a living material, sensitive to rain and erosion, the walls undergo regular restoration: what you admire today is therefore a thousand-year-old heritage that is constantly preserved.

The ramparts do more than mark out a perimeter: they trace the very soul of the old city. Nestled within is the Marrakech medina, a maze of alleys, souks, riads and lively squares, while to the south lies the historic district of the Marrakech kasbah, the former royal city. To understand the walls is therefore to grasp how the city organised and protected itself for nearly a thousand years.

Why is Marrakech “the red city” (or ochre city)?

The nickname “red city” — sometimes “ochre city” — is no tourist invention: it stems directly from the colour of the pisé that makes up the ramparts, as well as the great majority of the medina’s traditional buildings. This hue, ranging from pale pink to reddish brown depending on the light, comes from the ferruginous clay soil extracted in the Haouz plain and on the foothills of the Atlas. Rich in iron oxides, this earth naturally takes on warm shades that vary throughout the day.

What strikes visitors is Marrakech’s chromatic unity. To preserve this harmony, modern buildings in the historic centre are required to respect ochre tones close to those of the ancient walls. The result: whether you look at the gates of Marrakech, the walls of a riad or the distant silhouette of the minaret of the Koutoubia, everything speaks in the same palette. At daybreak, the city takes on a soft pink; at midday it turns a full ochre under the sun; at dusk it blazes with red and orange. It is this ever-changing spectacle that has inspired so many artists, painters and photographers.

The ramparts are undoubtedly the best place to witness this phenomenon. Walking alongside the walls in the late afternoon, when the low light brings out every contour of the pisé, helps you understand why Marrakech wears its nickname so well. It is a setting at once raw and poetic, where earth, sky and palm grove compose an unforgettable image.

Bab Agnaou: the finest gate of Marrakech

If you were to visit only one of the gates of Marrakech, it would without hesitation be Bab Agnaou. Unlike most of the city’s bab, conceived above all as defensive works in pisé, Bab Agnaou is a ceremonial gate, a masterpiece of Almohad art built at the end of the 12th century under the reign of Yacoub el-Mansour. It marked the main entrance to the royal kasbah, the district of power where the sultan and his court resided.

What sets Bab Agnaou apart is its sumptuous ornamentation. Carved from a local blue-grey stone (from the Atlas), it consists of an arch surrounded by finely sculpted concentric arches, framed by a frieze of Kufic inscriptions praising God. Floral motifs, shells and geometric interlacing adorn the whole with rare elegance. The contrast between the gate’s carved stone and the ochre pisé of the surrounding ramparts makes it an exceptional photographic subject.

Bab Agnaou, monumental gate of the Marrakech kasbah
Bab Agnaou, the finest gate in the city.

Bab Agnaou lies to the south of the medina, very close to Bab er-Robb and just a few steps from the Kasbah Mosque and the famous Saadian Tombs. It is an excellent starting point for exploring the kasbah district and then reaching the El Badi Palace, another must-see of the historic city. Take the time to observe the details of the carving: each ring of the arch tells of the refinement of the Almohad golden age.

The other main gates of Marrakech

Beyond Bab Agnaou, the enclosure is pierced by numerous gates, each with its own character and neighbourhood. Here are the main Bab of Marrakech to know as you plan your visit.

Bab Doukkala

Located to the north-west of the medina, Bab Doukkala takes its name from the Doukkala region on the Atlantic coast, towards which the road that once passed through it led. Today it is one of the busiest gates, near the bus station of the same name and a beautiful Saadian mosque. The surrounding neighbourhood, more working-class and less touristy, offers an authentic glimpse of everyday Marrakchi life.

Bab el-Khemis

To the north of the medina, Bab el-Khemis — the “Thursday gate” — owes its name to the weekly market once held here. It is now famous for its flea market and secondhand market, where bargain-hunters come to unearth old furniture, craft objects and curiosities. The gate itself, prettily decorated, is one of the best preserved and worth the detour, especially in the morning on market days.

Bab Debbagh

To the east of the medina, Bab Debbagh — the “tanners’ gate” — gives access to the historic tannery district, where leather is worked using artisanal methods unchanged for centuries. The gate, one of the oldest in the city, features a bent-axis plan characteristic of defensive architecture: a zigzag passage that once forced attackers to slow down. Nearby, the pungent smell of the tanning pits reminds you that you are approaching the beating heart of leather craftsmanship.

Bab er-Robb

Neighbouring Bab Agnaou to the south, Bab er-Robb is an Almohad gate whose name is said to evoke a grape syrup (the rob) once sold there, or the taxes that were collected at the spot. It marks one of the entrances towards the kasbah and the district of the Saadian Tombs. Its structure has been reworked over the centuries, but it retains a definite charm and a strategic position for reaching the south of the city.

Bab Aylen and Bab Ghmat

To the east, Bab Aylen is among the oldest gates, associated with a notable episode of Almoravid history: it was near it that one of the great Almohad offensives against the city took place. Bab Ghmat, not far away, opened onto the road to Aghmat, the ancient town that preceded Marrakech as the regional centre. These more discreet gates round out the circuit for visitors curious about history.

In all, the medina has around twenty gates, some monumental, others more modest. All tell a chapter of the city’s story: trade, defence, craftsmanship or power. Identifying them as you stroll turns a simple walk into a genuine journey through time.

Making the circuit of the ramparts: on foot or by carriage

There are two main ways to discover the walls of Marrakech as a whole. The first, the most immersive, is to walk alongside them. It is ideal for taking your time, getting up close to the pisé, observing the towers and photographing each gate. The full 19-kilometre circuit is nonetheless a long walk: most visitors settle for chosen sections, for example the southern stretch linking Bab Agnaou to the kasbah, or the northern portion between Bab Doukkala and Bab el-Khemis. Bring good shoes, water and a hat, as shade is scarce along the walls.

The second option, more restful and very popular, is the traditional horse-drawn carriage (the calèche or koutchi). These horse-drawn carriages wait notably around Jemaa el-Fna square and let you circle the outside of the ramparts effortlessly while enjoying the scenery. It is a romantic and panoramic way to take in the scale of the fortifications, particularly pleasant at the end of the day.

As an indicative figure, budget around 150 to 250 MAD per hour (roughly €14 to €23) for a carriage tour of the ramparts, a price to negotiate clearly before getting in, ideally for the whole trip and not per person. Prices vary with the season, the duration and your bargaining skill — a completely normal practice in Marrakech. Always check that the horse is well treated and favour coachmen who respect their animal.

To reach the various starting points, note that the medina is best explored on foot; for longer distances, see our guide on getting around Marrakech, which details taxis, carriages and other practical options.

The best photo spots and sunset views

The Marrakech ramparts are a dream for photographers, provided you choose the right moment. The golden light of late afternoon, known as the “golden hour”, enhances the ochre earth and brings out every texture of the pisé. Here are our favourite spots for capturing the walls.

  • Bab Agnaou: the delicacy of its carving, with the pisé in the background, offers the finest contrast. Ideal in late morning when the sun lights the façade.
  • The northern section near Bab el-Khemis: long, straight walls punctuated by towers, perfect for graphic compositions at dusk.
  • The edges of the palm grove and the palms along the walls: the combination of green palms and ochre ramparts, with a glowing sky, is striking at sunset.
  • The southern ramparts towards the kasbah: the low evening light draws long shadows there and makes the colour of the earth vibrate.
  • From a terrace or rooftop: several elevated cafés offer a plunging view over the walls and the ochre rooftops stretching to infinity.
The Koutoubia minaret in the ochre city at sunset
The ochre city ablaze at sunset.

A tip: arrive about 45 minutes before sunset to scout your framing and enjoy the changing light. The red of the walls intensifies as the sun sinks, offering a gradient of colours impossible to reproduce at any other hour. It is also the moment when the temperature becomes pleasant for strolling.

What to see near the gates: tanneries, souks and kasbah

One of the great advantages of the gates of Marrakech is that each gives access to a different world within the medina. Exploring the bab therefore also means discovering the treasures hidden just behind them.

Near Bab Debbagh, dive into the tannery district, an authentic and colourful spectacle where leather is worked by hand in large pits. Close to Bab Agnaou and Bab er-Robb, you are at the heart of the historic kasbah: the Kasbah Mosque, the Saadian Tombs and the El Badi Palace are just a few minutes’ walk away. Passing through the central gates, you quickly reach the famous souks of Marrakech, a labyrinth of shops piled high with spices, carpets, leather, ironwork and lamps.

From the western gates such as Bab Doukkala, it is easy to reach the city’s great gardens: the Menara Gardens and their olive-tree-framed basin offer a leafy escape with the Atlas as a backdrop. Each gate thus becomes the starting point for a themed exploration — crafts, history, gardens or trade — depending on your mood.

Visiting tips for discovering the ramparts

  • Choose the right hour: early morning for the cool air and soft light, or late afternoon for sunset. Avoid full midday in summer, when the heat can be overwhelming.
  • Wear good shoes: the areas around the ramparts are sometimes dusty and uneven; favour comfort.
  • Stay hydrated and protect yourself from the sun: water, a hat and sunscreen are essential, as shade is scarce along the walls.
  • Negotiate the carriage in advance: agree the price and the full itinerary before getting in, and check that the horse is in good condition.
  • Stay alert in traffic: some sections run alongside busy roads; cross carefully.
  • Combine with other sites: pair a visit to the gates with the nearby monuments (kasbah, souks, gardens) for a coherent day.
  • Dress respectfully: Marrakech is a traditional city; outfits covering shoulders and knees are appreciated.

To plan your whole stay and fit the ramparts into a balanced programme, see our complete guide to things to do in Marrakech as well as our Marrakech in 3 days itinerary, which will help you spread out your visits without rushing.

How much time to allow to visit the ramparts and the gates?

The ideal duration depends on your curiosity and your pace. For an express discovery of the most iconic Bab of Marrakech — Bab Agnaou, Bab er-Robb and a glimpse of the southern walls — allow about one hour to an hour and a half. It is perfect if you fit them into a visit to the kasbah and the Saadian Tombs.

For a fuller exploration, including several gates spread around the medina (Doukkala, el-Khemis, Debbagh) and a partial tour of the ramparts by carriage, allow half a day. Finally, if you want to make the full 19-kilometre circuit and wander through the districts adjoining each gate, a whole day will not be too much. The good news: the ramparts lend themselves to every format, from a quick glance to an in-depth route, and combine easily with the other must-sees of the red city.

Good to know: this guide is independently edited and is affiliated with neither ONDA nor any official body; the information, notably the prices, is provided for guidance only and may change.

FAQ: frequently asked questions about the Marrakech ramparts

How long are the Marrakech ramparts?

The ramparts extend for about 19 kilometres around the historic medina. Built in ochre rammed earth, they reach 6 to 9 metres high in places and are punctuated by numerous square watchtowers.

Who built the walls of Marrakech?

The walls were built in the 12th century by the Almoravids, under Sultan Ali ibn Yusuf around 1126, to protect the young capital. The following dynasties maintained and sometimes expanded them, but their layout dates back to that era.

What is the finest gate of Marrakech?

Bab Agnaou is generally considered the finest. This Almohad gate in carved stone, adorned with concentric arches and Kufic inscriptions, marked the monumental entrance to the royal kasbah. It stands apart from the other gates, most of which are built in pisé.

How much does a carriage tour of the ramparts cost?

As a guide, budget around 150 to 250 MAD (about €14 to €23) per hour for a carriage, a price to negotiate before getting in and for the full trip. Prices vary with the season and the duration.

Can you climb onto the Marrakech ramparts?

The ramparts are mainly visited from the outside, on foot or by carriage; they are not laid out as a walkway open to the public along their whole length. You therefore admire them by walking alongside, observing the gates and towers.

Why is Marrakech called the red city?

The nickname comes from the pinkish-ochre colour of the pisé that makes up the ramparts and most of the medina’s buildings. This hue comes from the clay soil rich in iron oxides used for construction, which gives the whole city its characteristic chromatic unity.

To go further, see the Marrakech article on Wikipedia as well as the listing of the medina inscribed as a UNESCO World Heritage Site.

Images under free licence via Wikimedia Commons: © Images George Rex (CC BY-SA 2.0); © Safia Shutterbug (CC BY-SA 3.0); © Misa.stefanovic.07 (CC BY-SA 4.0). Sources: Wikimedia Commons.Photo credits: illustrative images of the Marrakech ramparts and gates. Remember to credit your sources (royalty-free image banks or photographers) when publishing.

Scroll to Top