Persistent and progressive liver injury causes liver fibrosis due to the inability of the liver to regenerate. Interleukin (IL)-22 serves an important role in liver fibrosis. However, the underlying mechanism by which IL-22 exerts its effects on liver fibrosis has not been fully elucidated. The aim of the present study was to investigate the underlying mechanism by which IL-22 affects the development of liver fibrosis. Following activation of the hepatic stellate cells (HSCs) using transforming growth factor β (TGF-β), HSC proliferation was measured using the Cell Counting Kit-8 assay. The indicators of oxidative stress were detected using specific kits. In addition, the mRNA and protein expression levels of fibrosis-associated genes were determined using reverse transcription-quantitative polymerase chain reaction and western blot analysis, respectively. Subsequently, the protein expression levels of the NOD-like receptor protein 3 (NLRP3), caspase-1 and IL-1β were examined using western blotting. Following addition of Nigericin, a NLRP3 activator, the levels of oxidative stress and fibrosis were measured. IL-22 increased the viability of HSCs, which were activated by TGF-β. The malondialdehyde content was significantly decreased, whereas superoxide dismutase and glutathione levels were increased following IL-22 treatment. Moreover, IL-22 markedly downregulated the expression levels of fibrosis-associated genes, including α-smooth muscle actin, type I collagen and TIMP metallopeptidase inhibitor 1. Furthermore, the expression levels of NLRP3, caspase-1 and IL-1β were decreased in the IL-22-treated groups. However, the NLRP3 activator Nigericin reversed the inhibitory effects of IL-22 on the induction of oxidative stress and fibrosis of HSCs induced by TGF-β. In conclusion, the present study indicated that IL-22 alleviated the fibrosis of HSCs by inactivation of NLRP3 inflammasome signaling, which may provide further insight on the underlying mechanism by which IL-22 exerts protective effects on liver fibrosis.