Traditional Chinese medicine (TCM) is widely used as an important complementary and alternative healthcare system for cancer treatment in Asian countries. Network pharmacology, which utilizes various database platforms and computer software to study the interactions between complex drug components in vivo, is particularly useful for studying the pharmacodynamic mechanisms of multi-pathway and multi-target Chinese medicines. To explore the potential targets and function of Jianpi Yiwei Recipe treatment of gastric cancer (GC) through network pharmacology and molecular docking. Data on the components of Jianpi Yiwei Recipe (Radix Astragali, Radix Codonopsis, Agrimonia eupatoria, Atractylodes macrocephala Koidz., Poria cocos, stir-baked rhizoma dioscoreae, Amomum villosum Lour., fried Fructus Aurantii, pericarpium citri reticulatae, Rhizoma Pinelliae Preparata, and Radix Glycyrrhizae Preparata) were collected and screened by using the TCM systems pharmacology database and analysis platform (TCMSP). Then the targets of these compounds were predicted. GC-related targets were screened using the GeneCards database. Venn diagram was used to identify common targets. An active ingredient-core target interaction network and a protein-protein interaction (PPI) network were built. Moreover, we performed gene ontology (GO) functional annotation and Kyoto Encyclopedia of Genes and Genomes (KEGG) pathway enrichment analyses on the core targets and validated them by molecular docking. TCMSP screening revealed 11 active components and 184 targets, whereas GeneCards found 10118 disease-related targets, with 180 shared targets between them. Topology analysis of the PPI network identified 38 targets, including ATK1, TP53, and tumor necrosis factor, as key targets for the treatment of GC by Jianpi Yiwei Recipe. Quercetin, naringenin, luteolin, etc., may be the main active components of Jianpi Yiwei Recipe. GO enrichment analysis identified 2809, 1218, and 553 functions related to biological process, molecular function, and cellular component, respectively. KEGG pathway enrichment analysis revealed 167 related pathways, mainly involved in cancer, endocrine resistance, and AGE-RAGE signaling in diabetic complication. Validation with molecular docking analysis showed docking of key active components with core targets. Jianpi Yiwei Recipe plays a therapeutic role in GC through multiple components, targets, and pathways. These findings form a basis for follow-up exploration of Jianpi Yiwei Recipe in the treatment of GC.