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, 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 tobe apocryphal.