Purpose. Kangxian decoction (KXD) has been used in clinical practice to treat epilepsy. The purpose of this study was to explore the active components of KXD and clarify its antiepileptic mechanism through network pharmacology and molecular docking. Methods. The components of KXD were collected from the Encyclopedia of Traditional Chinese Medicine (ETCM) database and the literature was searched. Then, active ingredients were screened by SwissADME and potential targets were predicted by the SwissTargetPrediction database. Epilepsy-related differentially expressed genes were downloaded from the Gene Expression Omnibus database. A component-target-pathway network was constructed with Cytoscape. Kyoto Encyclopedia of Genes and Genomes (KEGG) enrichment analysis and protein‒protein interaction network analysis revealed the potential mechanism and critical targets. Receiver operating characteristic (ROC) curves and box plots in microarray data validated the good diagnostic value and significant differential expression of these critical genes. Molecular docking verified the association between active ingredients and essential target proteins. Results. In our study, we screened the important compounds of KXD for epilepsy, including quercetin, baicalin, kaempferol, yohimbine, geissoschizine methyl ether, baicalein, etc. KXD may exert its therapeutic effect on epilepsy through the following targets: PTGS2, MMP9, CXCL8, ERBB2, and ARG1, acting on the following pathways: neuroactive ligand-receptor interactions, arachidonic acid metabolism, IL-17, TNF, NF-kappa B, and MAPK signaling pathways. The molecular docking results showed that the active ingredients in KXD exhibited good binding ability to the key targets. Conclusion. In this study, we explored the possibility that KXD for epilepsy may act on multiple targets through multiple active ingredients, involving neurotransmitters and neuroinflammatory pathways, providing a theoretical basis for subsequent clinical and experimental studies that will help develop effective new drugs to treat epilepsy.