Inflammatory bowel diseases involve the dynamic interaction of host genetics, the microbiome and inflammatory responses. Here we found lower expression of NLRP12 (which encodes a negative regulator of innate immunity) in human ulcerative colitis, by comparing monozygotic twins and other patient cohorts. In parallel, Nlrp12 deficiency in mice caused increased basal colonic inflammation, which led to a less-diverse microbiome and loss of protective gut commensal strains (of the family Lachnospiraceae) and a greater abundance of colitogenic strains (of the family Erysipelotrichaceae). Dysbiosis and susceptibility to colitis associated with Nlrp12 deficency were reversed equally by treatment with antibodies targeting inflammatory cytokines and by the administration of beneficial commensal Lachnospiraceae isolates. Fecal transplants from mice reared in specific-pathogen-free conditions into germ-free Nlrp12-deficient mice showed that NLRP12 and the microbiome each contributed to immunological signaling that culminated in colon inflammation. These findings reveal a feed-forward loop in which NLRP12 promotes specific commensals that can reverse gut inflammation, while cytokine blockade during NLRP12 deficiency can reverse dysbiosis.