Background. Sufficient evidence indicated the crucial role of NF-κB family played in gastric cancer (GC). The novel discovery that NF-κB could regulate cancer metabolism and immune evasion greatly increased its attraction in cancer research. However, the correlation among NF-κB, metabolism, and cancer immunity in GC still requires further improvement. Methods. TCGA, hTFtarget, and MSigDB databases were employed to identify NF-κB-related metabolic genes (NFMGs). Based on NFMGs, we used consensus clustering to divide GC patients into two subtypes. GSVA was employed to analyze the enriched pathway. ESTIMATE, CIBERSORT, ssGSEA, and MCPcounter algorithms were applied to evaluate immune infiltration in GC. The tumor immune dysfunction and exclusion (TIDE) algorithm was used to predict patients’ response to immunotherapy. We also established a NFMG-related risk score by using the LASSO regression model and assessed its efficacy in TCGA and GSE62254 datasets. Results. We used 27 NFMGs to conduct an unsupervised clustering on GC samples and classified them into two clusters. Cluster 1 was characterized by high active metabolism, tumor mutant burden, and microsatellite instability, while cluster 2 was featured with high immune infiltration. Compared to cluster 2, cluster 1 had a better prognosis and higher response to immunotherapy. In addition, we constructed a 12-NFMG (ADCY3, AHCY, CHDH, GUCY1A2, ITPA, MTHFD2, NRP1, POLA1, POLR1A, POLR3A, POLR3K, and SRM) risk score. Followed analysis indicated that this risk score acted as an effectively prognostic factor in GC. Conclusion. Our data suggested that GC subtypes classified by NFMGs may effectively guide prognosis and immunotherapy. Further study of these NFMGs will deepen our understanding of NF-κB-mediated cancer metabolism and immunity.