Chefchaouen was founded in 1471 by Ali ibn Rashid al-Alami as a base for resistance against the Portuguese, who were pushing into northern Morocco from Ceuta. It was quickly settled by Moorish and Jewish refugees fleeing the Spanish Reconquista — the same wave of expulsions that shaped Córdoba and Granada after 1492 — who brought with them the Andalusian architectural traditions of courtyards, tiled fountains and whitewashed plaster that still define the medina today. The town remained largely closed to non-Muslims until the early 20th century; the first European to enter and leave safely was the explorer Charles de Foucauld in 1883, disguised as a rabbi.
The blue walls that give the town its current appearance date from the 1930s, when the Jewish community began painting the buildings blue — a colour associated in Jewish tradition with heaven and divinity. The practice spread through the medina and has been maintained since, though the specific shade varies by street and neighbourhood from pale powder blue to deep cobalt. The central square, Plaza Uta el-Hammam, is anchored by the Grand Mosque and the remains of the 15th-century kasbah beside it. The medina’s lanes are narrower and steeper than those of Fez or Marrakech, and the town is small enough to cover the main quarter in two to three hours on foot.
Chefchaouen sits at approximately 600 metres in the western Rif Mountains, which keeps it cooler than the lowland cities in summer. The Rif landscape above the town — accessible on foot within 20 minutes from the medina — gives the best views over the tiled rooftops and the valley below. As a Muslim-majority town, halal food is the default. The town is typically visited as a day trip or one-night stop on the route between Fez and Tangier, or as a standalone destination for those who want a slower-paced alternative to Marrakech. Spring and autumn are the most comfortable visiting windows; July and August are hot and the town is at its busiest with European and domestic tourists.
Best time to visit
March to May and September to November

