Gastric cancer is a malignant tumor with high morbidity and mortality all around the world. Because of its poor prognosis and low survival rate, the treatment of gastric cancer has received extensive attention. Cinnamaldehyde (CA) is the main single active component of the Chinese herbal medicine cinnamon, which has a variety of pharmacological effects. The inhibitory effect of CA on the growth of some tumor cells has been proven, but its therapeutic effect on gastric cancer has rarely been reported. Through network pharmacology, bioinformatics methods, and molecular docking technology, we predicted the interaction targets of CA and gastric cancer. Moreover, we found that apoptosis is an important mode of action of CA on gastric cancer cells. Subsequently, we validated it in gastric cancer cell lines cultured in vitro. The results showed that in the presence of CA, the Jak2/Stat3 pathway was inhibited, the ratio of Bcl-2/Bax decreased, and the apoptosis of gastric cancer cells was promoted in a concentration-dependent. In conclusion, CA can promote the apoptosis of gastric cancer cells by inhibiting the activity of the Jak2/Stat3 pathway, which may achieve the effect of treating gastric cancer.