It is well established that human body is an ecosystem for numerous microorganisms: bacteria, fungi, eukaryotic parasites, and viruses. They form a “microbiome” that under conditions of homeostasis remains in a friendly mutual relationship with the host. However, the composition and diversity of this microbe community is dynamic and can be changed under the influence of environmental factors, such as diet, antibiotic therapy, lifestyle, and the host’s genotype and immunity. The result of gut microbiome dysbiosis can lead even to cancer. The aim of this review is the description of the healthy gastrointestinal microbiome and the role of two infectious agents: Gram-negative bacteria Helicobacter pylori and Epstein-Barr virus in the development of gastric cancer in terms of gut dysbiosis. H. pylori is the most important pathogen of gastric microbiome with clear impact on its diversity. Coinfection with Epstein-Barr virus causes chronic gastritis, and the inflammatory process is significantly increased. The process of carcinogenesis begins with chronic inflammation that causes atrophic gastritis, intestinal metaplasia, dysplasia, and finally cancer. It has been proven that chronic inflammatory infection caused by infectious agents increases the risk of stomach cancer. Molecular methods that are progressively used to explore the human microbiome provide hope that this knowledge will be used for future diagnoses and therapy in the state of its dysbiosis and in cases of gastric cancer.