TMEM106B, a lysosomal transmembrane protein, has been closely associated with brain health. Recently, an intriguing link between TMEM106B and brain inflammation has been discovered, but how TMEM106B regulates inflammation is unknown. Here, we report that TMEM106B deficiency in mice leads to reduced microglia proliferation and activation and increased microglial apoptosis in response to demyelination. We also found an increase in lysosomal pH and a decrease in lysosomal enzyme activities in TMEM106B-deficient microglia. Furthermore, TMEM106B loss results in a significant decrease in the protein levels of TREM2, an innate immune receptor essential for microglia survival and activation. Specific ablation of TMEM106B in microglia results in similar microglial phenotypes and myelination defects in mice, supporting the idea that microglial TMEM106B is critical for proper microglial activities and myelination. Moreover, the TMEM106B risk allele is associated with myelin loss and decreased microglial numbers in humans. Collectively, our study unveils a previously unknown role of TMEM106B in promoting microglial functionality during demyelination.