Depression is a complex clinical disorder associated with poor outcomes. Electroacupuncture (EA) has been demonstrated to have an important role in both clinical and pre-clinical depression investigations. Evidence has suggested that the P2X7 receptor (P2X7R), NLRP3, and IL-1β play an important role in depressive disorder. Our study is aimed at exploring the role of EA in alleviating depression-like behaviors in rats. We therefore investigated the effects of EA on the prefrontal cortex and liver of rats subjected to chronic unpredictable mild stress (CUMS) through behavior tests, transmission electron microscopy, Nissl staining, HE staining, immunohistochemistry and Western blotting. Five weeks after exposure to CUMS, Sprague-Dawley (SD) rats showed depression-like behavior. Three weeks after treatment with brilliant blue G (BBG) or EA, depressive symptoms were significantly improved. Liver cells and microglia showed regular morphology and orderly arrangement in the BBG and EA groups compared with the CUMS group. Here we show that EA downregulated P2X7R/NLRP3/IL-1β expression and relieved depression-like behavior. In summary, our findings demonstrated the efficacy of EA in alleviating depression-like behaviors induced by CUMS in rats. This suggests that EA may serve as an adjunctive therapy in clinical practice, and that P2X7R may be a promising target for EA intervention on the liver–brain axis in treatment of depression.