Vitamin D deficiency is associated with the development of autoimmunity, which arises from defects in T cell tolerance to self-antigens. Despite the clinical and pre-clinical data supporting this association, the potential benefit of vitamin D supplementation in patients with active autoimmune disease is unclear, although birth cohort studies have shown that vitamin D status during childhood may represent a critical window to prevent the onset of future autoimmune disease. Central tolerance of thymocytes to self-antigen develops in the thymus and depends on the medullary thymic epithelial cell (mTEC) transcription factor autoimmune regulator (Aire), which drives tissue-restricted antigen (TRA) gene expression. This is critical for thymic self-antigen presentation and negative selection of auto-reactive T cells. We found that vitamin D signaling regulates Aire and TRA expression in mTECs, providing a basis for links between vitamin D deficiency and autoimmunity. We also found that the Vdr is abundantly expressed in the embryonic mouse thymus, where most Vdr+ cells were thymic epithelial cells. The majority of mature Aire+ mTECs in embryos do not co-express the Vdr, suggesting differential regulation during early developmental timepoints. However, the frequency of Aire+/VDR+ mTECs increases postnatally. In studies with adult mice lacking Cyp27b1, which cannot produce hormonally active vitamin D, or the Vdr, we observed profoundly reduced thymic cellularity, with impaired differentiation of Aire+ mTECs, attenuated TRA gene expression, and poorly organized thymic architecture. Markers of T cell negative selection were diminished, and organ-specific autoantibodies were present in Cyp27b1 knockout mice. Single-cell RNA sequencing revealed that loss of Cyp27b1 skews mTEC differentiation toward Ccl21+/Aire- intertypical TECs and generates a gene expression profile consistent with premature aging. Indeed, Cyp27b1 deficient thymi display accelerated involution and reduced expression of thymic longevity factors. Thus, loss of thymic vitamin D signaling disrupts normal mTEC differentiation and function and accelerates thymic aging.