NOD2 functions as an intracellular sensor for microbial pathogen and plays an important role in epithelial defense. The loss-of-function mutation of NOD2 is strongly associated with human Crohn's disease (CD). However, the mechanisms of how NOD2 maintains the intestinal homeostasis and regulates the susceptibility of CD are still unclear. Here we found that the numbers of intestinal intraepithelial lymphocytes (IELs) were reduced significantly in Nod2(-/-) mice and the residual IELs displayed reduced proliferation and increased apoptosis. Further study showed that NOD2 signaling maintained IELs via recognition of gut microbiota and IL-15 production. Notably, recovery of IELs by adoptive transfer could reduce the susceptibility of Nod2(-/-) mice to the 2,4,6-trinitrobenzene sulfonic acid (TNBS)-induced colitis. Our results demonstrate that recognition of gut microbiota by NOD2 is important to maintain the homeostasis of IELs and provide a clue that may link NOD2 variation to the impaired innate immunity and higher susceptibility in CD.