As the tissue macrophages of the CNS, microglia are critically involved in diseases of the CNS. However, it remains unknown what controls their maturation and activation under homeostatic conditions. We observed substantial contributions of the host microbiota to microglia homeostasis, as germ-free (GF) mice displayed global defects in microglia with altered cell proportions and an immature phenotype, leading to impaired innate immune responses. Temporal eradication of host microbiota severely changed microglia properties. Limited microbiota complexity also resulted in defective microglia. In contrast, recolonization with a complex microbiota partially restored microglia features. We determined that short-chain fatty acids (SCFA), microbiota-derived bacterial fermentation products, regulated microglia homeostasis. Accordingly, mice deficient for the SCFA receptor FFAR2 mirrored microglia defects found under GF conditions. These findings suggest that host bacteria vitally regulate microglia maturation and function, whereas microglia impairment can be rectified to some extent by complex microbiota.