Postnatal immune activation (PIA) induces persistent glial activation in the brain and causes various neuropathologies in adults. Exercise training improves stress-related mood disorders; however, the role of exercise in psychiatric disorders induced by early-life immune activation and the association between exercise training and glial activation remain unclear. We compared the effects of different exercise intensities on the PIA model, including high-intensity interval training (HIIT) and moderate-intensity continuous training (MICT). Both HIIT and MICT in adolescent mice inhibited neuroinflammation, remodeled synaptic plasticity, and improved PIA-induced mood disorders in adulthood. Importantly, HIIT was superior to MICT in terms of reducing inflammation and increasing body weight. RNA-seq of prefrontal cortex (PFC) tissues revealed a gene expression pattern, confirming that HIIT was more effective than MICT in improving brain glial cell activation through epigenetic modifications of KDM6B. We investigated the role of KDM6B, a specific histone lysine demethylation enzyme — histone 3 lysine 27 demethylase, in inhibiting glial activation against PIA-induced depression and anxiety by regulating the expression of IL-4 and brain-derived neurotrophic factor (BDNF). Overall, our data support the idea that HIIT improves PIA-induced mood disorders by regulating KDM6B-mediated epigenetic mechanisms and indicate that HIIT might be superior to MICT in improving mood disorders with PIA in mice. Our findings provide new insights into the treatment of anxiety and depression disorders.