BackgroundUnderstanding how the host’s microbiome shapes phenotypes and participates in the host response to selection is fundamental for evolutionists and animal and plant breeders. Currently, selection for resilience is considered a critical step in improving the sustainability of livestock systems. Environmental variance (VE), the within-individual variance of a trait, has been successfully used as a proxy for animal resilience. Selection for reducedVEcould effectively shift gut microbiome composition; reshape the inflammatory response, triglyceride, and cholesterol levels; and drive animal resilience. This study aimed to determine the gut microbiome composition underlying theVEof litter size (LS), for which we performed a metagenomic analysis in two rabbit populations divergently selected for low (n= 36) and high (n= 34)VEof LS. Partial least square-discriminant analysis and alpha- and beta-diversity were computed to determine the differences in gut microbiome composition among the rabbit populations.ResultsWe identified 116 KEGG IDs, 164 COG IDs, and 32 species with differences in abundance between the two rabbit populations studied. These variables achieved a classification performance of theVErabbit populations of over than 80%. Compared to the highVEpopulation, the lowVE(resilient) population was characterized by an underrepresentation ofMegasphaerasp.,Acetatifactor muris,Bacteroidetes rodentium,Ruminococcus bromii,Bacteroidetes togonis, andEggerthellasp. and greater abundances ofAlistipes shahii,Alistipes putredinis,Odoribacter splanchnicus,Limosilactobacillus fermentum, andSutterella, among others.Differences in abundance were also found in pathways related to biofilm formation, quorum sensing, glutamate, and amino acid aromatic metabolism. All these results suggest differences in gut immunity modulation, closely related to resilience.ConclusionsThis is the first study to show that selection forVEof LS can shift the gut microbiome composition. The results revealed differences in microbiome composition related to gut immunity modulation, which could contribute to the differences in resilience among rabbit populations. The selection-driven shifts in gut microbiome composition should make a substantial contribution to the remarkable genetic response observed in theVErabbit populations.Video AbstractSupplementary InformationThe online version contains supplementary material available at 10.1186/s40168-023-01580-4.