Various kinds of immune cells-including macrophages, dendritic cells, T cells and B cells- express the vitamin D receptor and 1α-hydroxylase (CYP27B1), the enzyme necessary for the conversion of circulating 25-hydroxyvitamin D into its active form, 1,25-dihydroxyvitamin D. It suggests that vitamin D has a regulatory role on innate and adaptive immune responses. Vitamin D has been recently shown to promote antimicrobial responses through the production of antibacterial peptides, and stimulation of the autophagic activity in macrophages. Recent epidemiological evidence indicates a significant association between vitamin D deficiency and an increased incidence of several infectious diseases. Here, we review the essential roles of vitamin D in modulating the immune system and discuss the protective effects of vitamin D supplementation in diverse infections.