Barrett's esophagus (BE) is a well-known precancerous condition of esophageal adenocarcinoma. However, the immune cells and immune related genes involved in BE development and progression are not fully understood. Therefore, our study attempted to investigate the roles of immune cells and immune related genes in BE patients. The raw gene expression data were downloaded from the GEO database. The limma package in R was used to screen differentially expressed genes (DEGs). Then we performed the least absolute shrinkage and selection operator (LASSO) and random forest (RF) analyses to screen key genes. The proportion of infiltrated immune cells was evaluated using the CIBERSORT algorithm between BE and normal esophagus (NE) samples. The spearman index was used to show the correlations of immune genes and immune cells. Receiver operating characteristic (ROC) curves were used to assess the diagnostic value of key genes in BE. A total of 103 differentially expressed immune-related genes were identified between BE samples and normal samples. Then, 7 genes (CD1A, LTF, FABP4, PGC, TCF7L2, INSR,SEMA3C) were obtained after Lasso analysis and RF modeling. CIBERSORT analysis revealed that resting CD4 T memory cells and gamma delta T cells were present at significantly lower levels in BE samples. Moreover, plasma cell and regulatory T cells were present at significantly higher levels in BE samples than in NE samples. INSR had the highest AUC values in ROC analysis. We identified 7 immune related genes and 4 different immune cells in our study, that may play vital roles in the occurrence and development of BE. Our findings improve the understanding of the molecular mechanisms of BE.