Bailemian capsule (BLMC) is composed of lily bulb, thorny Acanthopanax root, and other traditional Chinese medicines; it is commonly used to treat insomnia in traditional Chinese medicine. However, the active ingredients and mechanisms of action that underlie this treatment ability have not been fully explored. Here, a liquid chromatography-tandem mass spectrometry method was developed to qualitatively analyse the exogenous BLMC components that directly entered the blood and several brain regions after administration of BLMC to mice. A total of 47 compounds that directly entered the blood, including isoleucine. Moreover, there were 33, 34, 36, and 27 compounds distributed in the hypothalamus, hippocampus, frontal cortex, and temporal cortex of the mice, respectively. Subsequently, this study integrated network pharmacology, metabolomics and gut microbiota analysis to explore potential mechanism of BLMC against insomnia. The network pharmacology results suggest that BLMC affects insomnia by modulating the glutamatergic synaptic pathway. And serum and hypothalamic metabolomics analysis indicates that BLMC mainly regulates the metabolic pathways of D-Glutamine and D-Glutamic acid metabolism, significantly upregulating the differential metabolite glutamic acid and downregulating glutamine. In addition, analysis of gut microbiota indicates a close relationship between norank_f_Desulfovibirosaceae and glutamic acid. This study systematically revealed for the first time the potential pharmacological components of BLMC in treating insomnia, and explored its mechanism of action from multiple perspectives, laying the foundation for further exploration of the mechanism of BLMC in treating insomnia.