β-Caryophyllene (BCP), a selective agonist for cannabinoid receptor 2 (CB2R), has demonstrated promising protective effects in various pathological conditions. However, the neuroprotective effects of BCP on white matter damage induced by ischemic stroke have not been elucidated previously. In this study, we find that BCP not only improves sensorimotor and cognitive function via CB2R but also mitigates white matter lesions in mice following ischemic stroke. Furthermore, BCP enhances the viability of MO3.13 oligodendrocytes after oxygen-glucose deprivation and reoxygenation (OGD/R), attenuating OGD/R-induced cellular damage and pyroptosis. Notably, these protective effects of BCP are partially enhanced by the NLRP3 inhibitor MCC950 and counteracted by the NLRP3 activator nigericin. In addition, nigericin significantly exacerbates neurological outcomes and increases white matter lesions following BCP treatment in middle cerebral artery occlusion (MCAO) mice. These results suggest that BCP may ameliorate neurological deficits and white matter damage induced by cerebral ischemia through inhibiting NLRP3-mediated pyroptosis.