The purpose of this study is to investigate the potential mechanisms of Chinese herbs for the treatment of insomnia using a combination of data mining, network pharmacology, and molecular-docking validation. All the prescriptions for insomnia treated by the academician Qi Wang from 2020 to 2022 were collected. The Ancient and Modern Medical Case Cloud Platform v2.3 was used to identify high-frequency Chinese medicinal herbs and the core prescription. The Traditional Chinese Medicine Systems Pharmacology and UniProt databases were utilized to predict the effective active components and targets of the core herbs. Insomnia-related targets were collected from 4 databases. The intersecting targets were utilized to build a protein–protein interaction network and conduct gene ontology enrichment analysis and Kyoto Encyclopedia of Genes and Genomes pathway enrichment analysis using the STRING database, Cytoscape software, and clusterProfiler package. Gene chip data (GSE208668) were obtained from the Gene Expression Omnibus database. The limma package was applied to identify differentially expressed genes (DEGs) between insomnia patients and healthy controls. To create a “transcription factor (TF)-miRNA-mRNA” network, the differentially expressed miRNAs were entered into the TransmiR, FunRich, Targetscan, and miRDB databases. Subsequently, the overlapping targets were validated using the DEGs, and further validations were conducted through molecular docking and molecular dynamics simulations. Among the 117 prescriptions, 65 herbs and a core prescription were identified. Network pharmacology and bioinformatics analysis revealed that active components such as β-sitosterol, stigmasterol, and canadine acted on hub targets, including interleukin-6, caspase-3, and hypoxia-inducible factor-1α. In GSE208668, 6417 DEGs and 7 differentially expressed miRNAs were identified. A “TF-miRNA-mRNA” network was constructed by 4 “TF-miRNA” interaction pairs and 66 “miRNA-mRNA” interaction pairs. Downstream mRNAs exert therapeutic effects on insomnia by regulating circadian rhythm. Molecular-docking analyses demonstrated good docking between core components and hub targets. Molecular dynamics simulation displayed the strong stability of the complex formed by small molecule and target. The core prescription by the academician Qi Wang for treating insomnia, which involves multiple components, targets, and pathways, showed the potential to improve sleep, providing a basis for clinical treatment of insomnia.