Medicinal plants (MPs) are important resources widely used in the treatment and prevention of diseases and have attracted much attention owing to their significant antiviral, anti-inflammatory, antioxidant and other activities. However, soil degradation, caused by continuous cropping, excessive chemical fertilizers and pesticide residues and heavy metal contamination, seriously restricts the growth and quality formation of MPs. Microorganisms, as the major biota in soil, play a critical role in the restoration of the land ecosystem. Rhizosphere microecology directly or indirectly affects the growth and development, metabolic regulation and active ingredient accumulation of MPs. Microbial resources, with the advantages of economic efficiency, harmless to environment and non-toxic to organisms, have been recommended as a promising alternative to conventional fertilizers and pesticides. The introduction of beneficial microbes promotes the adaptability of MPs to adversity stress by enhancing soil fertility, inhibiting pathogens and inducing systemic resistance. On the other hand, it can improve the medicinal quality by removing soil pollutants, reducing the absorption and accumulation of harmful substances and regulating the synthesis of secondary metabolites. The ecological and economic benefits of the soil microbiome in agricultural practices are increasingly recognized, but the current understanding of the interaction between soil conditions, root exudates and microbial communities and the mechanism of rhizosphere microecology affecting the secondary metabolism of MPs is still quite limited. More research is needed to investigate the effects of the microbiome on the growth and quality of different medicinal species. Therefore, the present review summarizes the main soil issues in medicinal plant cultivation, the functions of microbes in soil remediation and plant growth promotion and the potential mechanism to further guide the use of microbial resources to promote the ecological cultivation and sustainable development of MPs.