The first pharmacy to ever exist was established during the Abbasid caliphate
In Baghdad the first pharmacies, or drug stores, were established in 754, under the Abbasid Caliphate during the Islamic Golden Age. By the 9th century, these pharmacies were state-regulated.(Roman herbal medicine guidebook De Materia Medica of Dioscorides. Cumin & dill. c. 1334.)
Pharmaceuticals is one of the most-researched fields in the academic industry, but the history surrounding that particular topic is sparse compared to the impact its made world-wide. Before the advent of pharmacists, there existed apothecaries that worked alongside priests and physicians in regard to patient care.
The differentiation and separation of two scientific disciplines, medicine and pharmacy begins during the 12th century. Each differentiation by itself brings certain improvement and upgrading but at any level, this happens only when proper conditions are met. Therefore, in order for pharmacy to appear as a profession and to promoted to the level of science, certain conditions had to be met, namely the society and cultural forces had matured to the level of differentiation of these two disciplines, which have begun existing as completely independent disciplines in that time. For the history of pharmacy, it is very important to note the fact that we find the first beginnings of professional pharmacy among Arabic population. The first drug stores in the world were established in Arabic world (Baghdad 754). Considering the fact that Arabs had brought a great deal to pharmaceutical science and the fact that their search included some 2.000 substances, the goal of this work was formulated and medicinal herbs used in the treatment listed. The forms used that period are still used in the therapy and some formulations of drugs can be found in pharmacopeas even today. If we add to these reports the fact that most of the literature appearing in the field was also of Arabic origin and that many editions and translations of the pharmaceutical works from Arabic to Latin had been published ever since, the obvious contribution of Arabic science in the development of pharmacy becomes even more obvious.(ref)
The advances made in the Middle East in botany and chemistry led medicine in medieval Islam substantially to develop pharmacology. Muhammad ibn Zakarīya Rāzi (Rhazes) (865-915), for instance, acted to promote the medical uses of chemical compounds. Abu al-Qasim al-Zahrawi (Abulcasis) (936-1013) pioneered the preparation of medicines by sublimation and distillation. His Liber servitoris is of particular interest, as it provides the reader with recipes and explains how to prepare the “simples” from which were compounded the complex drugs then generally used. Sabur Ibn Sahl (d. 869), was, however, the first physician to initiate a pharmacopoeia, describing a large variety of drugs and remedies for ailments. Al-Biruni (973-1050) wrote one of the most valuable Islamic works on pharmacology entitled Kitab al-Saydalah (The Book of Drugs), where he gave detailed knowledge of the properties of drugs and outlined the role of pharmacy and the functions and duties of the pharmacist. Ibn Sina (Avicenna), too, described no less than 700 preparations, their properties, mode of action and their indications. He devoted in fact a whole volume to simple drugs in The Canon of Medicine. Of great impact were also the works by al-Maridini of Baghdad and Cairo, and Ibn al-Wafid (1008–1074), both of which were printed in Latin more than fifty times, appearing as De Medicinis universalibus et particularibus by `Mesue‘ the younger, and the Medicamentis Simplicibus by `Abenguefit‘. Peter of Abano (1250–1316) translated and added a supplement to the work of al-Maridini under the title De Veneris. Al-Muwaffaq’s contributions in the field are also pioneering. Living in the 10th century, he wrote The Foundations of the True Properties of Remedies, amongst others describing arsenious oxide, and being acquainted with silicic acid. He made clear distinction between sodium carbonate and potassium carbonate, and drew attention to the poisonous nature of copper compounds, especially copper vitriol, and also lead compounds. He also describes the distillation of sea-water for drinking
If you have more interest in the topic, you can read Islamic Science and the “Making of the European Renaissance (Transformations: Studies in the History of Science and Technology)” by George saliba.
In this book, Saliba outlines the conventional accounts of Islamic science, then discusses their shortcomings and proposes an alternate narrative. Using astronomy as a template for tracing the progress of science in Islamic civilization, Saliba demonstrates the originality of Islamic scientific thought. He details the innovations (including new mathematical tools) made by the Islamic astronomers from the thirteenth to sixteenth centuries, and offers evidence that Copernicus could have known of and drawn on their work. Rather than viewing the rise and fall of Islamic science from the often-narrated perspectives of politics and religion, Saliba focuses on the scientific production itself and the complex social, economic, and intellectual conditions that made it possible.