Essaouira was founded in 1760 by the ‘Alawî Sultân Muhammad bin ‘Abd Allâh (1757-1790) on a site known to European navigators as Mogador (after the shrine Sîdî Mogdûl). It was meant to serve as a port for the export of goods from Southern Morocco (the Souss, Marrakech) and from trans-Saharan trade, and for the import of European products. It necessitated a huge investment in terms of infrastructure, port facilities and fortifications, a task accomplished with the help of European engineers. From the outset the city had a diverse population. Initially, elements of the local Berber (Haha) and Arab (Chiadma) tribes provided labor for construction of the city. Then military contingents, including 'abîd al-Bukhârî (the Sultan's Black slave soldiers), and soldiers from Agadir, were permanently stationed there. These contingents account for the origin of three of the city's residential neighborhoods: Ahl Agadir, Bani Antar and Bouakhir.

The Sultan also settled a large number of Jewish merchant families (the tujjâr al-sultân , or “sultan's traders”) in Essaouira in order to take better advantage of their business connections with Jewish merchants in European cities such as Livorno, Liverpool, and Amsterdam. By the late 18th and early 19th centuries 40% of the city's population was Jewish. When the city's first mallâh (Jewish neighborhood), Mellah Kedim, became too small, a new Mellah was built.

Ideally situated with regard to the trade winds of the North Atlantic, Essaouira prospered in the triangular trade between Europe, Africa and the Americas in the age of the sail. The eight foreign consulates (Denmark, Britain, the Netherlands, France, Spain, Italy, Portugal, and Brazil ), mostly located in the Qasbah quarter, are a good indication of the importance of its historic trade connections. The presence of so many consulates helped give the city a cosmopolitan nature that still appeals to visitors today.

Essaouira is also an important center for Sufism. One of the main Regraga shrines is located in the city and it is the object of a major pilgrimage each spring. The Hamadcha, Aissawa and Gnawa Sufi orders are also very active in civic life. Other zâwiyas , often linked to specific crafts and trades, include the Tijâniyya, the Darqawiyya and the Qâdiriyya.

Essaouira's fortunes began to wane with the triumph of steam over sail. The reorganization of Morocco under colonial auspices marginalized it further as new, modern port facilities were built elsewhere: in Casablanca, Safi, and Agadir. Moreover, Essaouira was not linked to the national rail network and the city lost most of its commercial hinterland, including the city of Marrakech. As Essaouira experienced stagnation and slow decline, many of the elite, including its Jewish merchants, left the city for the rising economic and political centers of Casablanca and Rabat.

Essaouira's economy was dealt another major blow between 1948 and 1967 when most of its remaining Jewish population emigrated to Israel, France and Canada. Space in former Jewish neighborhoods was then filled with rural migrants. A process of “densification” and degradation of the old urban fabric set in. Several families would subdivide old houses with little maintenance or upkeep.

Perhaps in part because of its neglected state—its failure to develop—the city and its vicinity have preserved a distinct charm which has now emerged as a major asset for tourism. The city remains small, with little of the urban sprawl which characterizes more developed centers. Mostly, it is the Medina of Essaouira, with its 18 th century fortifications and its open, ordered, public spaces, which has inspired visitors and artists. It was used for movie sets a number of times in the past, by both foreign and Moroccan film makers. One of the best known foreign movies made in Essaouira is Orson Wells' production of Shakespeare's Othello, filmed in 1949.

Essaouira was discovered by the hippie movement in the late 1960's and early 1970's. Rock stars such as Jimmy Hendrix and Cat Stevens began spending time in the city and its neighboring villages, and the Living Theater of Julian Beck and Judith Malina found a home there for a time. Because of the presence of such celebrities, Essaouira became a destination for young people and artists who left an important mark on the cultural tourism that would develop later. The Living Theater, which combined elements of stage and visual arts, along with the psychedelic paintings with which hippies decorated the walls of their rooms, is thought to have inspired the first generation of Souiri painters: Boujemâa Lakhdar, Houssein Miloudi. It has also influenced the post-psychedelic Tribal or Gnaoua style typified by Mohamed Tabal and now closely associated with the culture of the city. Yet the hippie “boom” was short-lived and could not forestall the city's long decline.

Suddenly in the mid 1990's Essaouira began to experience an unprecedented explosion of tourist activities. This development has been unlike the mass tourism which generally characterizes Morocco . Tourists are drawn to Essaouira by its art scene, its Gnaoua culture and music, and the excellent windsurfing conditions. There are a number of annual music and art festivals, the biggest one being the Gnaoua World Music Festival in June. Numerous Moroccan and foreign artists reside in the city, which is renowned for is fine dining and its relaxed ambience.

As with any tourist boom, economic development has been unequal and not all boats have been able to catch the rising tide. Many small foreign investors, mostly from Europe , have bought properties in the old walled city and opened businesses: bead & breakfasts, restaurants, boutiques, etc. These businesses have created jobs, mostly of the low-skill, low-pay variety, and a process of gentrification has set in; poorer residents are unable to afford the new rents.

In 2001-2002, a multidisciplinary team of researchers from Al Akhawayn University investigated the impact the tourism boom was having on the city. Apart from myself, this team included Ahmed Driouchi (Economist), Driss Maghraoui (Historian), Abdelkrim Marzouk (Geographer) and John Shoup (Anthropologist), and was coordinated by Abdellatif Bencherifa (Geographer).