The migration is the key step for thymic T cells to enter circulation and then lymph nodes (LNs), essential for future immune surveillance. Although promoter‐based transcriptional regulation through Foxo1, Klf2, Ccr7, and Sell regulates T‐cell migration, it remains largely unexplored whether and how enhancers are involved in this process. Here we found that the conditional deletion of Med1, a component of the mediator complex and a mediator between enhancers and RNA polymerase II, caused a reduction of both CD4+ and CD8+ T cells in LNs, as well as a decrease of CD8+ T cells in the spleen. Importantly, Med1 deletion hindered the migration of thymic αβT cells into the circulation and then into LNs, accompanied by the downregulation of KLF2, CCR7, and CD62L. Mechanistically, Med1 promotes Klf2 transcription by facilitating Foxo1 binding to the Klf2 enhancer. Furthermore, forced expression of Klf2 rescued Ccr7 and Sell expression, as well as αβT‐cell migration into LNs. Collectively, our study unveils a crucial role for Med1 in regulating the enhancer‐based Foxo1‐Klf2 transcriptional program and the migration of αβT cells into LNs, providing valuable insights into the molecular mechanisms underlying T‐cell migration.