Gastric cancer is one of the most common malignancies worldwide. Interleukin‐1‐beta (IL‐1β) is a pro‐inflammatory cytokine and potent inhibitor of gastric acid secretion. Some studies provided evidence of the association between IL‐1B 31 polymorphism and gastric cancer risk while other studies did not. Therefore, we conducted a comprehensive meta‐analysis to reassess the association. A systematic literature search of the PubMed and EMBASE databases identified 37 studies with 6108 cases and 8980 controls for this meta‐analysis. The crude odd ratios (ORs) and the 95% confidence intervals (CIs) were calculated to evaluate the strength of the association. Meta‐regression was used to determine the major source of heterogeneity across the studies. The pooled analysis did not suggest the significant association of IL‐1B 31 C>T polymorphism with gastric cancer risk. Stratified analysis was performed by ethnicity, source of control, genotype method, and indicated a significantly increased gastric cancer risk associated with IL‐1B 31T variant in the population‐based subgroup (heterozygous model: OR = 1.22, 95% CI = 1.03–1.45). Moreover, stratified analysis by Helicobacter pylori infection status indicated that IL‐1B 31 polymorphism increased gastric cancer risk in infection‐positive subgroup (homozygous model: OR = 1.35, 95% CI = 1.02–1.78; heterozygous model: OR = 1.31, 95% CI = 1.04–1.66; recessive model: OR = 1.29, 95% CI = 1.04–1.61). The study suggested that IL‐1B 31 polymorphism might confer susceptibility to gastric cancer in the presence of H. pylori infection, indicating a gene–environment interaction in gastric carcinogenesis.