Vitamin D deficiency has been linked to an increased risk of a wide range of adverse health outcomes. The active form of vitamin D has an important role in calcium metabolism and in bone mineralisation, but the evidence for other health outcomes is mixed, with the strongest effects seen in the weakest epidemiological study designs. There are plausible pathways whereby vitamin D deficiency can impair immune function, resulting in both overactivity and increased risk of autoimmune disease, as well as immune suppression with poorer resistance to infection. Vitamin D status may influence the bacterial flora that constitute the microbiome and affect immune function through this route. Exposure of the skin to ultraviolet radiation causes the production of a range of chemicals, including vitamin D, and new research is exploring possible vitamin D-independent immunomodulatory pathways.