Marrakech's Ramparts and Gates — The Red Walls, Bab by Bab
City Walls

Marrakech's Ramparts and Gates — The Red Walls, Bab by Bab

The red pise ramparts that ring the medina are the reason Marrakech is called the Red City. Raised in the 12th century and stretching nearly 19 kilometres, they are pierced by a series of historic gates, each with its own character and its own quarter beyond. This guide runs through the major babs — from the ceremonial Bab Agnaou to the tannery gate of Bab Debbagh — and the best ways to see the walls on foot, by caleche or by bike.

11 min read Updated July 2026 Marrakech, Morocco

What they are

The medieval pise walls and gates enclosing the medina

First built

Early 12th century, under the Almoravids

Length

Nearly 19 km around the old city

Material

Red pise (rammed earth), giving the 'Red City' colour

Gates

Around twenty historic babs

Grandest gate

Bab Agnaou, the ceremonial Kasbah gate

Best light

Late afternoon, for the deepest red tones

By City Tours Morocco Editorial Team

Published 17 July 2026 Last updated 17 July 2026

Why the Walls Are Red

Marrakech earns its nickname the Red City from these ramparts. They were first raised in the early twelfth century under the Almoravid sultan Ali ibn Yusuf to defend the young capital, and they were built from pise — a rammed-earth technique using the reddish local soil mixed with lime and packed into timber forms. That earthy red-ochre colour, repeated across the medina's houses by decree in later eras, is what gives the whole city its warm, unified glow, and it is the walls that set the tone.

Over the centuries the ramparts were repaired, extended and heightened by successive dynasties, so what you see today is a composite of many periods, still substantially following the medieval line. They run for nearly nineteen kilometres around the old city, rising to roughly eight or nine metres in places, thickened with square towers and broken by the gates that let the roads in and out. Pise needs constant maintenance, so you will often see sections being re-rendered — part of a living tradition of upkeep that has kept the walls standing for 900 years.

Bab Agnaou — The Grand Gate

If you see only one gate, make it Bab Agnaou. Built in the twelfth century under the Almohad caliph Yaqub al-Mansour, it was the ceremonial entrance to the royal Kasbah, and unlike the plain working gates it is a genuine monument: a monumental arch of carved blue-grey Gueliz stone, framed by concentric bands of floral and calligraphic decoration and a shell-like carved surround. It stands out from the red pise around it precisely because it was meant to impress those approaching the seat of power.

Bab Agnaou leads into the Kasbah quarter, the historic royal district that also holds the Saadian Tombs and the ruins of El Badi. That makes it the natural starting point for exploring the southern medina, and it is covered in more depth, as the gateway to that walk, in our Kasbah walking route guide. Stand back to take in the carving, then pass through into the quieter, grander streets of the old royal city — the contrast between the ornate gate and the working ramparts either side of it tells you a lot about how the medieval city was ordered.

The Working Gates

Most of the other babs are working gates, and their interest lies in the living quarters they open onto rather than in grand architecture. Bab Debbagh, on the eastern wall, is the tanneries gate — pass through it and you are in the malodorous, fascinating district where hides are still cured in the traditional way. Bab el Khemis, to the north, is the Thursday Gate, named for the flea market and second-hand souk that spills out beside it, one of the most local corners of the city. Bab Doukkala guards the northwestern approach near the bus and transport axes.

To the south, Bab er Robb sits close to Bab Agnaou and historically controlled the road towards the Atlas and Asni, while Bab el Jdid opens near the gardens on the western side. Each gate has its own trades, markets and character, and passing through them is one of the best ways to feel the medina as a lived-in city rather than a museum. The table below lists the major gates and what lies beyond each, so you can pick the ones that match where you are heading.

Gate (Bab)SideKnown for / leads to
Bab AgnaouSouthCeremonial Kasbah gate; Saadian Tombs, El Badi
Bab er RobbSouthNear Bab Agnaou; old road towards the Atlas
Bab DebbaghEastThe tanneries district
Bab AylenEastOne of the oldest gates; residential quarters
Bab el KhemisNorthThe Thursday flea market and second-hand souk
Bab DoukkalaNorthwestTransport axes; the Doukkala quarter
Bab el JdidWestNear the western gardens and hotels
Major Marrakech gates and what they lead to

Ways to See the Walls

You do not need to walk all nineteen kilometres to appreciate the ramparts — pick a method to suit your energy and time. On foot, the most rewarding stretch is the southern and western walls around the Kasbah and towards the gardens, where you can combine wall-watching with the Bab Agnaou monuments. The classic tourist option is a horse-drawn caleche, which does a leisurely circuit of the walls in about an hour, letting you see long sweeps of rampart and multiple gates without effort; agree the fare before you set off.

Cyclists and e-bikers can follow the roads that hug the outside of the walls for a faster, more complete loop, best attempted early or late to avoid traffic and heat. Whatever the method, timing matters more than the mode: the pise turns its deepest, most photogenic red in the low, warm light of late afternoon, when long shadows pick out the texture of the rammed earth and the towers. The table below compares the options so you can match the walls to the way you most enjoy travelling.

MethodBest forTimeNotes
On footDetail, combining with Kasbah sights1-2 hrs (a section)Free; choose the southern/western walls
Caleche (horse carriage)An easy full loop, families~1 hrAgree fare first; classic circuit
Bike / e-bikeA faster complete circuit1-1.5 hrsGo early/late; mind the traffic
Petit taxi drive-byA quick orientation20-30 minCheap; less atmospheric
Seeing the ramparts — options compared

Photographing and Timing the Ramparts

The ramparts are one of the best photographic subjects in Marrakech, but the light makes or breaks the shot. Aim for the golden hour before sunset, when the western sun rakes across the pise and turns it a deep, saturated red, throwing the towers and the pattern of the rammed earth into relief. The western and southern walls catch this light head-on, so a late-afternoon walk or caleche along that side, finishing near the gardens, is the reliable way to see the Red City actually looking red.

Early morning is the quieter alternative, cooler and with softer light and fewer people, good for detail shots of gates like Bab Agnaou. Avoid the flat, harsh light of midday, which drains the colour out of the walls. Keep an eye out for storks nesting on the towers and old gates — a common and photogenic sight — and remember that the gates are busy working thoroughfares, so stand clear of the traffic of scooters, carts and taxis pouring through them as you frame your shot.

Fitting the Walls Into a Marrakech Day

The ramparts work best as a frame for the rest of your sightseeing rather than a standalone outing. A natural plan is to spend the day in the southern medina — the Kasbah, the Saadian Tombs and the palaces and museums — entering and leaving through Bab Agnaou, then close with a late-afternoon caleche loop of the walls as the light turns and the pise glows. That way the ramparts bookend a day of interiors with a sense of the city's overall shape and defences.

Because the gates open onto such different worlds — tanneries at Bab Debbagh, flea market at Bab el Khemis, royal quarter at Bab Agnaou — you can also use them to plan which quarter to explore next. Orientation is the practical payoff: once you understand the ring of walls and where each bab sits, the medina's tangle of lanes makes far more sense, and you always know which gate to aim for when you want to get out to a taxi, a bus or the gardens beyond.

The Walls in the City's Story

The ramparts are not just a backdrop; they are the reason Marrakech took the shape it did. By enclosing the medina, they fixed the boundary between the old city and everything built later, which is why the walled medina remains so distinct from the modern districts of Gueliz and Hivernage beyond. For most of the city's history the gates were shut at night and controlled who and what came in and out, so the walls governed the rhythm of trade, defence and daily life as much as they defined the skyline.

That role echoes into the present. The walled medina is inscribed as a UNESCO World Heritage site, and the pise ramparts are a large part of what that recognition protects, alongside the monuments and the living urban fabric inside them. Modern Marrakech has grown far beyond the walls, but planning rules that keep the medina low-rise and red-toned mean the ramparts still read as the edge of the historic city rather than a relic marooned in traffic. Walking or riding their circuit remains the single best way to grasp the medina as a whole before you dive into its lanes.

Frequently Asked Questions

Why is Marrakech called the Red City?

Because of these ramparts and the medina they enclose. The 12th-century walls are built from pise, rammed earth made with the reddish local soil, giving them a warm red-ochre colour. Later eras extended that colour across the city's houses, so the whole medina glows the same red, especially in low light. The walls set the tone, and a late-afternoon walk or ride alongside them is the best way to see Marrakech actually looking like the Red City.

What is Bab Agnaou?

Bab Agnaou is the grandest of Marrakech's gates, built in the 12th century under the Almohads as the ceremonial entrance to the royal Kasbah. Unlike the plain working gates, it is a carved monument of blue-grey stone framed by bands of floral and calligraphic decoration. It leads into the Kasbah quarter, home to the Saadian Tombs and El Badi, and makes the natural starting point for exploring the southern medina.

How long are the Marrakech ramparts?

They run for nearly 19 kilometres around the medina, rising to roughly eight or nine metres in places and thickened with square towers, broken by around twenty historic gates. You do not need to see all of them — the most rewarding stretches are the southern and western walls near the Kasbah and gardens. A horse-drawn caleche circuit covers a long sweep of the ramparts and multiple gates in about an hour.

What is the best way to see the city walls?

It depends on your energy. On foot you get detail and can combine the southern walls with the Kasbah sights; a horse-drawn caleche does an easy full loop in about an hour; and a bike or e-bike covers a faster complete circuit if you go early or late to dodge traffic and heat. Whatever you choose, aim for late afternoon, when the low sun turns the pise its deepest, most photogenic red.

Which gate leads to the tanneries?

Bab Debbagh, on the eastern wall, is the tanneries gate — passing through it brings you into the district where hides are still cured in the traditional way. It is one of several working gates whose interest lies in the living quarter beyond rather than in grand architecture, alongside Bab el Khemis (the Thursday flea market) to the north and Bab Doukkala (transport axes) to the northwest.

When is the best time to photograph the ramparts?

The golden hour before sunset is best, when the western sun rakes across the pise and turns it a deep, saturated red, picking out the towers and the texture of the rammed earth. The western and southern walls catch this light head-on. Early morning is a quieter alternative with softer light, good for gate detail, while harsh midday sun drains the colour and is best avoided. Watch for storks nesting on the towers.

Plan it with a local expert

Travel Morocco with Serenity Morocco Tours

Crafting extraordinary journeys through Morocco's timeless landscapes. 100% private journeys, handcrafted around you.

Moroccan-owned 100% Private Tours 100% private tours since 2018
Sahara Desert Luxury Expedition — Marrakech → Erg Chebbi, Morocco
from $2,011
5 days Marrakech → Erg Chebbi

Sahara Desert Luxury Expedition

Essential Morocco: Imperial Cities Circuit — Marrakech · Fes · Meknes · Rabat, Morocco
from $2,054
7 days Marrakech · Fes · Meknes · Rabat

Essential Morocco: Imperial Cities Circuit

Sahara to Sea: Morocco Complete — Full-country circuit, Morocco
from $5,978
14 days Full-country circuit

Sahara to Sea: Morocco Complete

Browse all 15+ private tours — from $924 →