Background: Despite the long-established importance of zebrafish (Danio rerio) as a model organism and their increasing use in microbiome-targeted studies, relatively little is known about how husbandry practices involving diet impact the zebrafish gut microbiome. Given the microbiome’s important role in mediating host physiology and the potential for diet to drive variation in microbiome composition, we sought to clarify how three different dietary formulations that are commonly used in zebrafish facilities impact the gut microbiome. We compared the composition of gut microbiomes in approximately 60 AB line adult (4- and 7-month-old) zebrafish fed each diet throughout their lifespan. Results: Our analysis finds that diet has a substantial impact on the composition of the gut microbiome in adult fish, and that diet also impacts the developmental variation in the gut microbiome. We further evaluated whether the 7-month-old fish microbiome compositions that result from dietary variation are differentially sensitive to infection by a common laboratory pathogen, Mycobacterium chelonae. Our analysis finds that the gut microbiome’s sensitivity to M. chelonae infection varies as a function of diet, especially for moderate and low abundance taxa. Conclusions: Overall, our results indicate that diet drives the successional development of the gut microbiome as well as its sensitivity to exogenous exposure. Consequently, investigators should carefully consider the role of diet in their microbiome zebrafish investigations, especially when integrating results across studies that vary by diet.