Our previous studies have reported that pre-stimulation of microglia before stress stimulation is a possible strategy to prevent depression-like phenotypes; however, the molecular mechanisms underlying this effect are still unclear. Here, we used β-glucan, a polysaccharide from Saccharomyces cerevisiae with immunomodulatory activities that cannot elicit pro-inflammatory responses in microglia, to address this issue. Our results showed that a single injection of β-glucan one day before stress exposure dose-dependently prevented the depression-like behaviors triggered by chronic unpredictable stress (CUS), which peaked at 20 mg/kg and prevented the impairment of hippocampal brain-derived neurotrophic factor (BDNF) signaling, a pathological process critical for the progression of depression-like phenotypes. Inhibition of BDNF signaling by infusion of an anti-BDNF antibody into the hippocampus, knock-in of the mutant BDNF Val68Met allele, or blockade of the BDNF receptor in the hippocampus abolished the preventive effect of β-glucan on CUS-induced depression-like behaviors. Further analysis showed that cAMP-response element binding protein (CREB)-mediated increase of BDNF expression in the hippocampus was essential for the prevention of depression-like phenotypes by β-glucan. Pretreatment with minocycline or PLX3397 before β-glucan injection to suppress microglia abolished the preventive effect of β-glucan on impaired CREB-BDNF signaling in the hippocampus and depression-like behaviors in CUS mice. These results suggest that an increase in hippocampal BDNF following CREB activation triggered by β-glucan-induced microglia stimulation and subsequent TrkB signaling mediates the preventive effect of β-glucan on depression. β-Glucan may be a more suitable immunostimulant for the prevention of depression due to its inability to promote pro-inflammatory responses in microglia.