Background. Astragalus membranaceus (AM, family: Leguminosae) exerts significant therapeutic effect on gastric ulcer (GU); however, there are scarce studies on its molecular mechanism against GU. This study aims to explore the key ingredients, key targets, and potential mechanisms of AM in the treatment of GU by utilizing network pharmacology and molecular docking. Methods. Several public databases were used to predict the targets of AM and GU, respectively, and the drug and disease targets were intersected to obtain the common targets. Next, the key ingredients and key targets were identified by constructing ingredient-target network and protein-protein-interaction (PPI) network. Gene Ontology biological processes (GOBP) and Kyoto Encyclopedia of Genes and Genomes (KEGG) pathway enrichment analysis were carried out on the common targets in order to ascertain the biological processes and signaling pathways involved. Finally, molecular docking was conducted to verify the binding affinity between the key ingredients and key targets. Results. A total of 552 predicted targets were obtained from 23 screened active ingredients, of which 203 targets were the common targets with GU. Quercetin, kaempferol, and isorhamnetin were identified as the key ingredients by constructing ingredient-target network, and TP53, AKT1, VEGFA, IL6, TNF, CASP3, and EGFR were selected as the key targets by constructing PPI network. GOBP and KEGG pathway enrichment analysis suggested that the therapeutic effect of AM on GU involved multiple biological processes and signaling pathways related to inflammation, oxidative stress, apoptosis, cell proliferation, and angiogenesis. Molecular docking validation demonstrated that all key ingredients had good binding affinity with the key targets. Conclusion. This study revealed the key ingredients, key targets, and potential mechanisms of AM against GU, and these data may provide some crucial references for subsequent research and development of drugs for treating GU.