Herkinorin is a novel opioid receptor agonist. Activation of opioid receptors, a member of G protein coupled receptors (GPCRs), may play an important role in Herkinorin neuroprotection. GPCRs may modulate NOD‐like receptor protein 3 (NLRP3)‐mediated inflammatory responses in the mechanisms of inflammation‐associated disease and pathological processes. In this study, we investigated the effects of Herkinorin on NLRP3 and the underlying receptor and molecular mechanisms in oxygen‐glucose deprivation/reperfusion (OGD/R)‐treated rat cortex neurons. First, Western blot analysis showed that Herkinorin can inhibit the activation of NLRP3 and Caspase‐1, decrease the expression of interleukin (IL)‐1β, and decrease the secretion of IL‐6 and tumour necrosis factor α detected by enzyme‐linked immunosorbent assay in OGD/R‐treated neurons. Then we found that Herkinorin downregulated NLRP3 levels by inhibiting the activation of nuclear factor kappa B (NF‐κB) pathway, reducing the phosphorylation level of p65 and IκBα in OGD/R‐treated neurons (p < .05 or .01, n = 3 per group). Instead, both the mu opioid receptor (MOR) inhibitor, β‐funaltrexamine, and MOR knockdown reversed the effects of Herkinorin on NLRP3 (p < .05 or .01, n = 3 per group). Further, we found that the level of β‐arrestin2 decreased in the cell membrane and increased in the cytoplasm after Herkinorin pretreatment in OGD/R‐treated neurons. In co‐immunoprecipitation experiments, Herkinorin increased the binding of IκBα with β‐arrestin2, decreased the ubiquitination level of IκBα, and β‐arrestin2 knockdown reversed the effects of Herkinorin on IκBα in OGD/R‐treated neurons (p < .05 or .01, n = 3 per group). Our data demonstrated that Herkinorin negatively regulated NLRP3 inflammasome to alleviate neuronal ischemic injury through inhibiting NF‐κB pathway mediated primarily by MOR activation. Inhibition of the NF‐κB pathway by Herkinorin may be achieved by decreasing the ubiquitination level of IκBα, in which β‐arrestin2 may play an important role.