Viral infections have been a cause of mortality for several centuries and continue to endanger the lives of many, specifically of the younger population. Vitamin D has long been recognized as a crucial element to the skeletal system in the human body. Recent evidence has indicated that vitamin D also plays an essential role in the immune response against viral infections and suggested that vitamin D deficiency increases susceptibility to viral infections as well as the risk of recurrent infections. For instance, low serum vitamin D levels were linked to increased occurrence of high burdens viral diseases such as hepatitis, influenza, Covid-19, and AIDS. As immune cells in infected patients are responsive to the ameliorative effects of vitamin D, the beneficial effects of supplementing vitamin D-deficient individuals with an infectious disease may extend beyond the impact on bone and calcium homeostasis. Even though numerous studies have highlighted the effect of vitamin D on the immune cells, vitamin D’s antiviral mechanism has not been fully established. This paper reviews the recent mechanisms by which vitamin D regulates the immune system, both innate and adaptive systems, and reflects on the link between serum vitamin D levels and viral infections.