Guipi Decoction is a famous Traditional Chinese Medicine formulae, which can be used to treat insomnia and depression. But its specific mechanism is still unclear. In this study, the active ingredients, targets and mechanisms of the Ziziphi Spinosae Semen-Poria cocos-Longan (ZPL) in Guipi Decocation was investigated by network pharmacology analysis and molecular docking. A total of 32 active ingredients, 344 intersection targets and 13 key targets were obtained. The result showed (S)-Coclaurine, coumestrol, n-trans-feruloyltyramine, ellagic acid, ellipticine and tartaric acid were the key compounds for depression. These compositions could reduce inflammatory response, inhibit pro-inflammatory cytokines, reduce neuronal apoptosis, and then modulate depression by the key targets of RAC-alpha serine/threonine-protein kinase (AKT1), tumor necrosis factor (TNF), interleukin (IL6), mitogen activated protein kinase 3 (MAPK3). Molecular docking results showed that the binding energy of n-trans-feruloyltyramine with PPARG was the lowest, -9.513 kcal/mol and the binding energy of (S)-Coclaurine and ESR1 was − 9.336. Upregulation of AKT1 gene inhibits apoptosis. Downregulation of TNF-α, MAPK and CTNNB1 genes reduces the expression of inflammatory factors and decreases the inflammatory response, which plays an important role in the treatment of depression. In conclusion, the active component of ZPL binds stably with AKT1, MAPK3, ESR1 and CTNNB1 and controlled the onset of depression by regulation of genes expression.