The development of sequencing technology has expanded our knowledge of the human gastric microbiome, which is now known to play a critical role in the maintenance of homeostasis, while alterations in microbial community composition can promote the development of gastric diseases. Recently, carcinogenic effects of gastric microbiome have received increased attention. Gastric cancer (GC) is one of the most common malignancies worldwide with a high mortality rate. Helicobacter pylori is a well-recognized risk factor for GC. More than half of the global population is infected with H. pylori, which can modulate the acidity of the stomach to alter the gastric microbiome profile, leading to H. pylori-associated diseases. Moreover, there is increasing evidence that bacteria other than H. pylori and their metabolites also contribute to gastric carcinogenesis. Therefore, clarifying the contribution of the gastric microbiome to the development and progression of GC can lead to improvements in prevention, diagnosis, and treatment. In this review, we discuss the current state of knowledge regarding changes in the microbial composition of the stomach caused by H. pylori infection, the carcinogenic effects of H. pylori and non-H. pylori bacteria in GC, as well as the potential therapeutic role of gastric microbiome in H. pylori infection and GC.