Inflammatory bowel disease (IBD) is a nonspecific inflammatory disease that includes ulcerative colitis (UC) and Crohn’s disease (CD). The pathogenesis of IBD is not fully understood but is most reported associated with immune dysregulation, dysbacteriosis, genetic susceptibility, and environmental risk factors. Vitamin D is an essential nutrient for the human body, and it not only regulates bone metabolism but also the immune system, the intestinal microbiota and barrier. Vitamin D insufficiency is common in IBD patients, and the abnormal low levels of vitamin D are highly correlated with disease activity, treatment response, and risk of relapse of IBD. Accumulating evidence supports the protective role of vitamin D in IBD through regulating the adaptive and innate immunity, maintaining the intestinal barrier and balancing the gut microbiota. This report aims to provide a broad overview of the role vitamin D in the immune system, especially in the pathogenesis and treatment of IBD, and its possible role in predicting relapse.