Environmental stresses experienced during development exert many long-term effects upon health and disease. For example, chemical oxidants or genetic perturbations that induce low levels of reactive oxygen species can extend lifespan in several species. In some cases, the beneficial effects of low-dose oxidants are attributed to adaptive protective mechanisms such as mitohormesis, which involve long-term increases in the expression of stress response genes. Here we show in Drosophila that transient exposure to low concentrations of oxidants during development leads to an extension of adult lifespan. Surprisingly, this depends upon oxidants acting in an antibiotic-like manner to selectively deplete the microbiome of Acetobacter proteobacteria. We demonstrate that the presence of Acetobacter species, such as A. aceti, in the indigenous microbiota increases age-related gut dysfunction and shortens lifespan. This study demonstrates that low-dose oxidant exposure during early life can extend lifespan via microbiome remodelling rather than mitohormesis.