The prevalence of gastric ulcers is increasing worldwide, especially those brought on by non-steroidal anti-inflammatory drugs (NSAIDS), so prevention is extremely crucial. The protective potential of carbon monoxide (CO) in several inflammatory disorders has been clarified. The goal of the current study was to investigate the gastroprotective effect of CO produced by its pharmacological donor (CORM2) and its nanoparticles (NPs) against indomethacin (INDO)-induced ulcers. Investigations on CORM2's dose-dependent effects were also conducted. For induction of gastric ulcer, 100 mg kg−1of INDO was given orally. Before ulcer induction, CORM2 (5, 10, and 15 mg kg−1), CORM2 nanoparticles (5 mg kg−1), or ranitidine (30 mg kg−1) were given intraperitoneally for 7 days. Ulcer score, gastric acidity, gastric contents of malondialdehyde (MDA), nitric oxide (NO), heme oxygenase-1 (HO-1), and carboxyhemoglobin (COHb) blood content were estimated. Additionally, gene expression of nuclear factor erythroid 2-related factor 2 (NRF2) and immunohistochemical staining of cyclooxygenase-1 (COX-1) as well as cyclooxygenase-2 (COX-2) were analyzed. Results demonstrated a substantial dose-dependent decrease in ulcer score, pro-inflammatory indicators, and oxidative stress markers with CORM2 and its NPs. Furthermore, CORM2 and its NPs markedly increased NRF2, COX-1, and HO-1, but CORM2 NPs outperformed CORM2 in this regard. In conclusion, the CO released by CORM2 can protect against INDO-induced gastric ulcers dose dependently, and the highest used dose had no effect on COHb concentration.