The history of coffee goes at least as far back as the 10th century, with a number of reports and legends surrounding its first use. The native (undomesticated) origin of coffee is thought to have been Ethiopia. The earliest substantiated evidence of either coffee drinking or knowledge of the coffee tree is from the 15th century, in the Sufi monasteries of Yemen. By the 16th century, it had reached the rest of the Middle East, South India, Persia, Turkey, Horn of Africa, and northern Africa. Coffee then spread to the Balkans, Italy and to the rest of Europe, to Indonesia and then to America.
The word "coffee" entered the English language in 1582 via the Dutch koffie, borrowed from the Turkish kahve, in turn borrowed from the Arabic qahwah ( قهوة).
The word qahwah originally referred to a type of wine, whose etymology is given by Arab lexicographers as deriving from the verb qahā (قها, "to lack hunger") in reference to the drink's reputation as an appetite suppressant. The word qahwah is sometimes alternatively traced to the Arabic quwwa ("power, energy"), or to Kaffa, a medieval kingdom in Ethiopia whence the plant was exported to Arabia. These etymologies for qahwah have all been disputed, however. The name qahwah is not used for the berry or plant (the products of the region), which are known in Arabic as bunn and in Oromo as būn. Semitic had a root qhh "dark color", which became a natural designation for the beverage. According to this analysis, the feminine form qahwah (also meaning "dark in color, dull(ing), dry, sour") was likely chosen to parallel the feminine khamr (خمر, "wine"), and originally meant "the dark one".
The Ethiopian ancestors of today's Oromo ethnic group were the first to have recognized the energizing effect of the native coffee plant. Studies of genetic diversity have been performed on Coffea arabica varieties, which were found to be of low diversity but with retention of some residual heterozygosity from ancestral materials, and closely related diploid species Coffea canephora and C. liberica; however, no direct evidence has ever been found indicating where in Africa coffee grew or who among the natives might have used it as a stimulant or known about it there earlier than the seventeenth century. The original domesticated coffee plant is said to have been from Harar, and the native population is thought to be derived from Ethiopia with distinct nearby populations in Sudan and Kenya.
Coffee was primarily consumed in the Islamic world where it originated and was directly related to religious practices.
There are several legendary accounts of the origin of the drink itself. One account involves the Yemenite Sufi mystic Ghothul Akbar Nooruddin Abu al-Hasan al-Shadhili. When traveling in Ethiopia, the legend goes, he observed birds of unusual vitality, and, upon trying the berries that the birds had been eating, experienced the same vitality.
Other accounts attribute the discovery of coffee to Sheik Abou'l Hasan Schadheli's disciple, Omar. According to the ancient chronicle (preserved in the Abd-Al-Kadir manuscript), Omar, who was known for his ability to cure the sick through prayer, was once exiled from Mocha to a desert cave near Ousab. Starving, Omar chewed berries from nearby shrubbery, but found them to be bitter. He tried roasting the beans to improve the flavor, but they became hard. He then tried boiling them to soften the bean, which resulted in a fragrant brown liquid. Upon drinking the liquid Omar was revitalized and sustained for days. As stories of this "miracle drug" reached Mocha, Omar was asked to return and was made a saint.
Another probably fanciful account involves a 9th-century Ethiopian goat-herder, Kaldi, who, noticing the energizing effects when his flock nibbled on the bright red berries of a certain bush, chewed on the fruit himself. His exhilaration prompted him to bring the berries to a monk in a nearby monastery. But the monk disapproved of their use and threw them into the fire, from which an enticing aroma billowed, causing other monks to come and investigate. The roasted beans were quickly raked from the embers, ground up, and dissolved in hot water, yielding the world's first cup of coffee. Since this story is not known to have appeared in writing before 1671, 800 years after it was supposed to have taken place, it is highly likely to be apocryphal.
The earliest credible evidence of either coffee drinking or knowledge of the coffee tree appears in the middle of the 15th century, in Yemen's Sufi monasteries.
Coffee beans were first exported from Ethiopia to Yemen. Yemeni traders brought coffee back to their homeland and began to cultivate the bean. The word qahwa originally meant wine, and Sufis in Yemen used the beverage as an aid to concentration and as a kind of spiritual intoxication when they chanted the name of God. Sufis used it to keep themselves alert during their nighttime devotions. A translation of Al-Jaziri's manuscript traces the spread of coffee from Arabia Felix (the present day Yemen) northward to Mecca and Medina, and then to the larger cities of Cairo, Damascus, Baghdad, and Constantinople. By 1414, the beverage was known in Mecca, and in the early 1500s was spreading to the Mameluke Sultanate of Egypt and North Africa from the Yemeni port of Mocha. Associated with Sufism, a myriad of coffee houses grew up in Cairo (Egypt) around the religious University of the Azhar. These coffee houses also opened in Syria, especially in the cosmopolitan city of Aleppo, and then in Istanbul, the capital of the Ottoman Empire, in 1554. In 1511, it was forbidden for its stimulating effect by conservative, orthodox imams at a theological court in Mecca. However, these bans were to be overturned in 1524 by an order of the Ottoman Turkish Sultan Suleiman I, with Grand Mufti Mehmet Ebussuud el-İmadi issuing a fatwa allowing the consumption of coffee. In Cairo, Egypt, a similar ban was instituted in 1532, and the coffeehouses and warehouses containing coffee beans were sacked. During the 16th century, it had already reached the rest of the Middle East, the Safavid Empire and the Ottoman Empire. From the Middle East, coffee drinking spread to Italy, then to the rest of Europe, and coffee plants were transported by the Dutch to the East Indies and to the Americas.
Similarly, coffee was banned by the Ethiopian Orthodox Church some time before the 18th century. However, in the second half of the 19th century, Ethiopian attitudes softened towards coffee drinking, and its consumption spread rapidly between 1880 and 1886; according to Richard Pankhurst, "this was largely due to Emperor Menilek, who himself drank it, and to Abuna Matewos who did much to dispel the belief of the clergy that it was a Muslim drink."
The earliest mention of coffee noted by the literary coffee merchant Philippe Sylvestre Dufour is a reference to bunchum in the works of the 10th century CE Persian physician Muhammad ibn Zakariya al-Razi, known as Rhazes in the West, but more definite information on the preparation of a beverage from the roasted coffee berries dates from several centuries later. One of the most important of the early writers on coffee was Abd al-Qadir al-Jaziri, who in 1587 compiled a work tracing the history and legal controversies of coffee entitled Umdat al safwa fi hill al-qahwa عمدة الصفوة في حل القهوة. He reported that one Sheikh, Jamal-al-Din al-Dhabhani (d. 1470), mufti of Aden, was the first to adopt the use of coffee (circa 1454).
He found that among its properties was that it drove away fatigue and lethargy, and brought to the body a certain sprightliness and vigour.