Cannabis in Morocco has been illegal since the nation's independence in 1956, reaffirmed by a total ban on drugs in 1974, but is partially tolerated in the country. Cannabis has been cultivated in Morocco for centuries and the country is currently among the world's top producers of hashish. As of 2016, Morocco is the world's top supplier of cannabis.
Though the specific period of cannabis's original introduction to Morocco is unclear, it is known to have arrived to the region during the Arab Conquests of the Maghreb, from the seventh to fifteenth centuries. From the sixteenth century it was grown nationwide on a small scale for local use, in gardens and orchards, but it was only in the 18th century that the Rif region in the far north became a noted center of production, as it is now recognized in modern times. In 1890, Sultan Hassan I instituted strict regulations on cultivation and trade, but also conferred clear cannabis production privileges on several Rif tribes. In the 1950s, the rights of the Rif tribes to cultivate cannabis was reconfirmed, in response to tensions in the restive region. In 1956, with the new independence of Morocco, King Mohammed V prohibited cannabis nationwide.
In the 1960s and 1970s, an influx of young Western tourists had a profound effect on cannabis in Morocco. Prior to this, cannabis was produced in small quantities, and smoked as kief, female flowers (unpollinated) mixed with black tobacco. In response to massive demand from tourists and smugglers, Moroccans growers adopted larger-scale techniques to replace artisanal ones. While there are competing legends as to how hashish production was first introduced to Morocco, it is widely believed to have occurred during the peak period of Western tourist influence.
Morocco produces a substantial portion of the world's hashish; it was the top producer for the 2002-2010 period before a 2012 study placed Afghanistan as the top producer. Morocco's 2010 production was 760 tons of cannabis resin. In 2003, 70% of Europe's hashish consumed was produced in Morocco.
In traditional production, cannabis stalks are cut from the field in autumn and stored indoors to dry for a month. The cultivators then place the dried stalks onto a fine fabric stretched across a metal basin, and beat the stalks, causing the THC-laden trichomes to fall into the basin for collection. The first kif beaten from the stalks is of the best quality, and the stalks can be further beaten a second and third time, however, continuously producing a lower-quality product. Some of the trichomes are packaged as-is, or they can be repeatedly pressed and heated to form dense slabs of hashish. Hashish slabs are often marked with a signature emblem indicating its producer, such as an abstract design, number, or imitation of a commercial logo. These symbols have no standardization or consistency season-to-season, but serve in the short term to mark the current output of a given producer.
With the increasingly publicized worldwide consumption of cannabis, Moroccan citizens have capitalized on the feasibility of the production of this drug in the mountainous Rif region, as well as the interest in cannabis from tourists. The area itself does not produce many crops other than kif, the Moroccan name for cannabis, creating ample space for tours of the region to take place. The cities of Chefchaouen and Ketama have become a hub for cannabis tourism in the past decades. 
Cannabis tourism has grown to become an important and dominant source of wealth for growers, dealers and unofficial tour guides alike. Tours are not officially advertised, and mostly occur by word-of-mouth. Hash pressing, tours, consumption of the drug, and sales are still illegal, but unofficially, the combination of these services has made the North African region one of the largest exporters of hashish, which is a produced from female cannabis plants through compression and heating of resin glands known as trichomes. This cash crop has provided a stable income and reliability for more than 90,000 households.
As Moroccan law officials continue to debate over the legality of producing cannabis for public use, production has started to become less criminalized. Recognizing that no other crops grow in the mountainous region, other than cannabis, the Moroccan government has been forced to allow farmers to continue their small production businesses. Producing hashish for European exports and visiting tourists provides a consistent form of employment and income for the farmers in the Rif region.  Distribution costs and pricing vary depending on the location and proximity to large cities. The further a site of production is from cities, the fewer distributors are needed, thus allocating all funds from sales to the growers themselves.  The surge of cannabis demand has also greatly increased the feasibility of the drug trade to remain a successful business throughout Morocco's ports and borders. 
While acceptance for cannabis production is growing, so is the inflation of prices and the devaluation of farmers' crops. Taxes pose a threat to the security of income that growers rely upon as their few means of economic gains. 
Prior to the internationalization of the cannabis trade, Moroccan kif was consumed locally, smoked in a long sebsi pipe or mixed into food, and was also used occasionally in Sufi religious rituals. Majoun is also a popular traditional edible, a candy or jam made of cannabis with the combination of honey and spices that is ingested to feel the sensations similar to those of smoking cannabis.
Cannabis was banned in Morocco following independence, however, the traditional tolerance for its production in the Rif region, plus the recognition that cannabis makes up a large share of the national economy, has led to debate in favor of legalizing cannabis. In 2009, Fouad Ali el Himma received multipartisan support amongst Moroccan politicians for his proposal to re-brand cannabis as a traditional Moroccan herbal remedy rather than a dangerous drug, and called for national debate and reduced prosecution of farmers. In 2014, the Party of Authenticity and Modernity proposed a draft law which would keep consumption of recreational cannabis illegal, but would license and regulate growers and redirect their output to licit medicinal and industrial cannabis products. While talks of legalizing cannabis in Morocco have been taboo for decades, it has become increasingly common to find discussion and support of the topic as of late.
- Zijlma, Anouk (31 July 2017). "Buying and Smoking Hashish (Kif) in Morocco". TripSavvy. Retrieved 5 August 2018.
- "Tourists roll up for Morocco's cannabis trail". CTV News. AFP. 4 December 2017. Retrieved 4 August 2018.
- "Some Arab governments are rethinking harsh cannabis laws". The Economist. Apr 12, 2017. Archived from the original on 14 April 2017. Retrieved 15 April 2017.
- Mr Martin Bouchard; Mr Tom Decorte; Dr Gary Potter (28 January 2013). World Wide Weed: Global Trends in Cannabis Cultivation and its Control. Ashgate Publishing, Ltd. pp. 40–. ISBN 978-1-4094-9438-6.
- Fredrik Söderbaum; Ian Taylor; Nordiska Afrikainstitutet (2008). Afro-regions: The Dynamics of Cross-border Micro-regionalism in Africa. Stylus Pub Llc. p. 130. ISBN 978-91-7106-618-3.
- Stephen Roffe (27 March 2014). Beyond Hercules: An inside story of the Moroccan hash trade. Indie Publishing Limited. pp. 90–. ISBN 978-0-9927455-0-9.
- Brian Preston (2002). Pot Planet: Adventures in Global Marijuana Culture. Grove Press. pp. 197–. ISBN 978-0-8021-3897-2.
- Robert Connell Clarke (1998). Hashish!. Red Eye Press. ISBN 978-0-929349-05-3.
- "Morocco, no longer the World's Largest Producer of Cannabis- UN report". Morocco World News. Archived from the original on 4 March 2016. Retrieved 28 July 2015.
- Giles Tremlett. "Ketama Gold puts Morocco top of Europe's cannabis league". the Guardian. Archived from the original on 18 May 2015. Retrieved 28 July 2015.
- Bob J. Zehmer (22 May 2013). Kif: Hashish from Morocco. eBookIt.com. pp. 74–. ISBN 978-1-4566-0020-4.
- Bowring, Philip (1993). "La Chine à la recherche des milliards évanouis". Perspectives Chinoises. 17 (1): 10–12. doi:10.3406/perch.1993.2847. ISSN 1021-9013.
- Schemm, Paul; Bellaoualli, Smail. "Breaking taboo, Morocco may okay pot in nod to struggling farmers". www.timesofisrael.com. Retrieved 2019-05-13.
- Joseph, Roger (1973). "The Economic Significance of Cannabis sativa in the Moroccan Rif". Economic Botany. 27 (2): 235–240. doi:10.1007/BF02872993. ISSN 0013-0001. JSTOR 4253416.
- Ketterer, James (2001). "Networks of Discontent in Northern Morocco: Drugs, Opposition and Urban Unrest". Middle East Report (218): 30–45. doi:10.2307/1559308. ISSN 0899-2851. JSTOR 1559308.
- Allen, Chris (1999). "Editorial: Africa & the Drugs Trade". Review of African Political Economy. 26 (79): 5–11. doi:10.1080/03056249908704357. ISSN 0305-6244. JSTOR 4006519.
- Mateo Dieste, Josep Lluís, 1968- (2013). Health and ritual in Morocco : conceptions of the body and healing practices. Boston: Brill. ISBN 9789004234482. OCLC 816320465.CS1 maint: multiple names: authors list (link)
- Bowles, Paul, 1910-1999. (1993). Conversations with Paul Bowles. Caponi-Tabery, Gena. Jackson: University Press of Mississippi. ISBN 978-0878056491. OCLC 28213693.CS1 maint: multiple names: authors list (link)
- "Morocco's growing Cannabis debate". Foreign Policy. Archived from the original on 2017-04-07.
- "Morocco, top hash provider, mulls legislation to break marijuana taboo and legalize growing". The Globe and Mail. Archived from the original on 2016-03-05.
- "Tunisia and Morocco want more liberal cannabis policies". sensiseeds.com. 22 May 2017. Archived from the original on 30 March 2018. Retrieved 24 April 2018.