Allium species are popular vegetables in China and possess antifungal and antibacterial activities. This study aimed to compare the endophytic bacterial community in the four crucial Allium species in China, Chinese leek (CL), garlic (GA), onion (ON,) and Welsh onion (WO), using sequences of the V3–V4 region of the bacterial 16S rRNA gene. A total of 1,036,637 high-quality sequences and 719 operational taxonomic units (OTUs) were obtained across all libraries. A total of 20 phyla, 50 classes, 80 orders, 134 families, and 234 genera were identified. Among them, 18 OTUs and 19 genera were shared among the four Allium species. Proteobacteria (42.68%) and Bacteroidetes (20.18%) were the dominant phyla in CL, while one unclassified (>70%) was the dominant phyla in the other three Allium species. The alpha-diversity analysis showed the bacterial richness and diversity in CL were significantly higher than those in the other three Allium species. Principal coordinate analysis (PCA) showed endophytic bacterial communities in GA, WO, and ON were more similar than those in CL. Phylogenetic Investigation of Communities by Reconstruction of Unobserved States (PICRUSt) analysis revealed endophytic bacteria mostly enriched in Membrane Transport, Amino Acid Metabolism and Carbohydrate Metabolism pathway. 17 of the 23 Kyoto Encyclopedia of Genes and Genomes (KEGG) categories and 159 of the 206 lower-level KEGG pathways in CL were significantly higher than those in the other three Allium species. Pearson’s correlation indicated that KEGG pathways with significant differences among the Allium species were closely related to the bacterial genera with significant differences between the Allium species. The findings of our study provided insight into the complex endophytic microbial communities in Allium species.