Why is it blue? The theories are several and none is definitive. The most persistent holds that Jewish refugees from the Spanish Reconquista, arriving in the late fifteenth century, painted their homes blue as a reminder of the sky and of God — blue representing the heavens in Jewish tradition. A second theory points to the Andalusian origin of the city's founders, who carried a preference for indigo-washed walls from Spain. A third, more practical, holds that the blue paint contains chemicals that repel mosquitoes. What is documented is that the blue paint is relatively recent — photographs from the 1930s show the medina in white — and that it was applied in stages rather than all at once, which means the decision to be blue was accumulated rather than planned.
The city was founded in 1471 by Moulay Ali ibn Rashid to serve as a base for Moroccan resistance against the Portuguese, who were advancing along the Atlantic coast. For the first four hundred years of its existence, Chefchaouen was closed to non-Muslims — Christians and Jews were forbidden to enter on pain of death. An exception was made for the Jewish traders who serviced the city's markets from outside its walls. The American journalist Walter Harris managed to enter in disguise in 1889. The Spanish took the city in 1920 and found a community that had preserved Andalusian Arabic, Andalusian music, and Andalusian ceramic traditions in a kind of cultural refrigeration for five centuries.
The medina is small — an hour covers it end to end — and built on a slope rising toward two peaks that give the Rif mountains their local character: cedar-forested, steep, and consistently green in a country that the coastal visitor assumes is mostly dry. The main square, the Plaza Uta el-Hammam, has a kasbah and a Grand Mosque with an octagonal minaret — unusual in Morocco, where square minarets are the rule, the octagonal form reflecting Andalusian influence. The cafés in the square serve mint tea and kefta to backpackers and local families in roughly equal proportion.
The Rif mountains are Morocco's cannabis-producing region — a fact that shapes the economy of the province and the behaviour of some visitors in ways worth knowing before arrival. The cannabis culture is open, the quality is famous, and the legal status is technically illegal while practically tolerated in small quantities for personal use. The same ambiguity that produced Tangier's international zone operates here at a different scale.
The best approach is to arrive in the late afternoon, when the light on the blue walls does what every photograph promises. The worst time to be here is a July or August weekend: the medina has a capacity problem and the summer crowds reach densities that defeat the intimacy the city is selling. October and November are the best months — warm enough, empty enough, and the Rif cedars turning colour on the slopes above the town. The bus from Tangier takes two hours. The bus from Fes takes about four.