Cycling · noviembre 4, 2026
Riding the Ramparts: A Complete Loop Around Marrakech’s Ancient City Walls
Few cities in the world still have their medieval walls almost complete. Marrakech does. Nearly 900 years after they were built, the red earthen ramparts still wrap around the old city for about 19 kilometres, punctuated by monumental gates, towers and storks’ nests.
Riding all the way around them is one of the best ways to understand Marrakech. In a single morning you pass gardens, markets, tanneries, cemeteries, royal palaces and everyday neighbourhoods, all seen from the outside of the medina looking in.
A short history of the walls
The ramparts were built in the 1120s by the Almoravid sultan Ali ibn Yusuf, to protect the young city from attack. They were made of tabia, a mix of earth, lime and stones pressed into wooden moulds, which gives them their famous pinkish-red colour. Look closely and you’ll see rows of small holes in the walls: they held the wooden beams of the moulds during construction.
Over the centuries, the walls were extended and repaired by later dynasties. Today there are around 200 towers and about twenty gates, called bab in Arabic. Each gate has its own name, history and personality.
The gates you’ll pass
Bab Doukkala
On the north-west side, Bab Doukkala is a large Almoravid gate that once led toward the Doukkala region on the Atlantic coast. Nearby is a lively local neighbourhood with a busy market and food stalls.
Bab el-Khemis
In the north, Bab el-Khemis means the “Thursday gate”, after the market once held outside it. Today a famous flea market sells everything from old doors to bicycle parts.
Bab Debbagh
On the east side, Bab Debbagh is the “tanners’ gate”, next to the traditional tanneries. Inside the gate is a bent passage built to slow down attackers. If it’s open, the view from its roof is spectacular.
Bab Aghmat and Bab Ahmar
In the south-east, these gates lead toward the Atlas Mountains and the royal area. Near Bab Aghmat lies the tomb of Yusuf ibn Tashfin, the founder of Marrakech.
Bab Agnaou and Bab er-Robb
In the south-west, Bab Agnaou is the beautiful carved stone gate of the Kasbah. Next to it, Bab er-Robb is the main gate for travellers heading south toward the mountains.
Bab Jdid
On the west side, Bab Jdid, the “new gate”, opens toward Hivernage and the famous Mamounia hotel. It’s the perfect point to finish your loop.
The ramparts loop by bike
The full loop is about 19 to 20 km and mostly flat. With stops, plan for around three hours. We recommend riding with an experienced guide the first time, as some sections share busy boulevards with traffic.
- Start at Bab Doukkala in the north-west, early in the morning.
- Ride north and east past Bab el-Khemis and the flea market.
- Stop at Bab Debbagh and peek at the tanneries.
- Continue south past Bab Aghmat and the tomb of Yusuf ibn Tashfin.
- Ride along the south side, past the Agdal Gardens and the royal walls.
- Stop at Bab Agnaou and Bab er-Robb.
- Finish at Bab Jdid, then cool down in the shady Koutoubia Gardens.
Practical tips
- Start early. The roads around the walls are calm at sunrise, and the light on the red walls is magical.
- Late afternoon is beautiful too, especially in winter, when the walls glow orange. Read our guide to the sunset bike tour in Marrakech.
- Bring water and sun protection. There is little shade on some stretches.
- Watch for traffic. Some sections are on busy boulevards. Stay right and ride steadily.
- Take breaks at the gates. That’s where the stories are.
Beyond the walls
Once you’ve circled the city, you might want to see where the roads lead next. For multi-day cycling journeys across Morocco, take a look at Morocco Cycling Tours. For mountain biking in the High Atlas, beyond the snowy peaks you can see from the ramparts, visit Atlas Mountain Bike.
Ride the ramparts with us
Our guided ramparts ride follows the safest sections, stops at the most interesting gates, and brings 900 years of history to life.
Frequently asked questions
How long are the walls of Marrakech? About 19 km around the medina.
How long does the loop take by bike? Around three hours with stops. Without stops, an experienced rider can do it in about 1.5 hours.
Is the ramparts loop difficult? It’s flat and suitable for most riders with basic cycling experience. The main challenge is traffic on some sections, which is why a guided tour is a good idea for a first ride.
Can I climb the walls? Generally no, though at some gates, like Bab Debbagh, it is sometimes possible to go up to the roof.