Blue light emitted by smartphones and tablets at night increases the risk of depression. Pu-erh tea has been reported to reduce the risk of depression by regulating tryptophan metabolism, but its underlying protective mechanism on depression induced by blue light at night (BLAN) remains unclear. In this work, two groups of C57BL6/J mice were given water or 0.25% (w/v) Pu-erh tea for 120 days, followed by a 45-day BLAN treatment (400 lux blue light between 21:00 and 23:00) to simulate blue light emitted from electronic equipment. Our results indicated that BLAN induced depression-like behaviors and gut microbiota disorders in healthy mice. Pu-erh tea intake significantly reshaped the gut microbiome (especially Bifidobacterium) and regulated the metabolism of short-chain fatty acids (SCFAs) which protected the integrity of the intestinal barrier. This improvement further reduced blood-brain barrier (BBB) damage and alleviated neuroinflammation by inhibiting MyD88/NF-κB pathways which finally regulated neurotransmitters such as brain-derived neurotrophic factor (BDNF) and serotonin (5-hydroxytryptamine, 5-HT). Collectively, 0.25% (w/v) Pu-erh tea has the potential to prevent BLAN-induced depression-like behaviors by reshaping the gut microbiota and increasing the generation of SCFAs via the gut-brain axis.