The tissue macrophages of the central nervous system (CNS), known as microglia, are essential for normal brain development and maintenance of the innate immune response of the CNS; however, the factors that control their maturation and activation have been unclear. Now, Erny et al. show that the intestinal microbiota has a major influence on the number, maturation and function of microglial cells in mice. Defects in the maturation and differentiation of microglia were observed both following eradication of the gut microbiota and in the presence of a microbial community of reduced complexity, whereas recolonization with a complex microbiota largely restored these defects. The authors find that short-chain fatty acids (SCFAs) produced by the microbiota function as mediators between the gut and the brain, as treatment of germ-free mice with a mixture of SCFAs reversed microglial impairments and mice deficient in the SCFA receptor FFAR2 exhibited similar defects to germ-free animals.