Alterations to the gut microbiome caused by changes in diet, consumption of antibiotics, etc., can affect host function. Moreover, perturbation of the microbiome during critical developmental periods potentially has long-lasting impacts on hosts. Using four selectively bred high runner and four non-selected control lines of mice, we examined the effects of early-life diet and exercise manipulations on the adult microbiome by sequencing the hypervariable internal transcribed spacer region of the bacterial gut community. Mice from high runner lines run ∼3-fold more on wheels than do controls, and have several other phenotypic differences (e.g. higher food consumption and body temperature) that could alter the microbiome, either acutely or in terms of coevolution. Males from generation 76 were given wheels and/or a Western diet from weaning until sexual maturity at 6 weeks of age, then housed individually without wheels on standard diet until 14 weeks of age, when fecal samples were taken. Juvenile Western diet reduced bacterial richness and diversity after the 8-week washout period (equivalent to ∼6 human years). We also found interactive effects of genetic line type, juvenile diet and/or juvenile exercise on microbiome composition and diversity. Microbial community structure clustered significantly in relation to both line type and diet. Western diet also reduced the relative abundance of Muribaculum intestinale. These results constitute one of the first reports of juvenile diet having long-lasting effects on the adult microbiome after a substantial washout period. Moreover, we found interactive effects of diet with early-life exercise exposure, and a dependence of these effects on genetic background.