BackgroundThe human gut microbiota is a complex community comprised of trillions of bacteria and is critical for the digestion and absorption of nutrients. Bacterial communities of the intestinal microbiota influence the development of several conditions and diseases. We studied the effect of host genetics on gut microbial composition using Collaborative Cross (CC) mice. CC mice are a panel of mice that are genetically diverse across strains, but genetically identical within a given strain allowing repetition and deeper analysis than is possible with other collections of genetically diverse mice.Results16S rRNA from the feces of 167 mice from 28 different CC strains was sequenced and analyzed using the Qiime2 pipeline. We observed a large variance in the bacterial composition across CC strains starting at the phylum level. Using bacterial composition data, we identified 17 significant Quantitative Trait Loci (QTL) linked to 14 genera on 9 different mouse chromosomes. Genes within these intervals were analyzed for significant association with pathways and the previously known human GWAS database using Enrichr analysis and Genecards database. Multiple host genes involved in obesity, glucose homeostasis, immunity, neurological diseases, and many other protein-coding genes located in these regions may play roles in determining the composition of the gut microbiota. A subset of these CC mice was infected withSalmonellaTyphimurium. Using infection outcome data, an increase in abundance of genusLachnospiraceaeand decrease in genusParasutterellacorrelated with positive health outcomes after infection. Machine learning classifiers accurately predicted the CC strain and the infection outcome using pre-infection bacterial composition data from the feces.ConclusionOur study supports the hypothesis that multiple host genes influence the gut microbiome composition and homeostasis, and that certain organisms may influence health outcomes afterS.Typhimurium infection.Video AbstractSupplementary InformationThe online version contains supplementary material available at 10.1186/s40168-023-01552-8.