Introduction: Magnesium (Mg2+) deficiency is a common finding in the early phase after kidney transplantation (KT) and has been linked to immune dysfunction and infections. Data on the association of hypomagnesemia and the rate of infections in kidney transplant recipients (KTRs) are sparse. Methods: We conducted a single-center retrospective cohort study of KTRs transplanted between 2005 and 2015. Laboratory data, including serum Mg2+ (median time of the Mg2+ measurement from KT: 29 days), rate of infections including mainly urinary tract infections (UTI), and common transplant-related viral infections (CMV, polyoma, EBV) in the early phase after KT were recorded. The primary outcome was the incidence of infections within one year after KT, while secondary outcomes were hospitalization due to infection, incidence rates of long-term (up to two years) infections, and all-cause mortality. Results: We enrolled 376 KTRs of whom 229 patients (60.9%) suffered from Mg2+ deficiency defined as a serum Mg2+ < 0.7 mmol/L. A significantly higher incidence rate of UTIs and viral infections was observed in patients with versus without Mg2+ deficiency during the first year after KT (58.5% vs. 47.6%, p = 0.039 and 69.9% vs. 51.7%, p < 0.001). After adjustment for potential confounders, serum Mg2+ deficiency remained an independent predictor of both UTIs and viral infections (odds ratio (OR): 1.73, 95% CI: 1.04–2.86, p = 0.035 and OR: 2.05, 95% CI: 1.23–3.41, p = 0.006). No group differences according to Mg2+ status in hospitalizations due to infections and infection incidence rates in the 12–24 months post-transplant were observed. In the Cox regression analysis, Mg2+ deficiency was not significantly associated with all-cause mortality (HR: 1.15, 95% CI: 0.70–1.89, p = 0.577). Conclusions: KTRs suffering from Mg2+ deficiency are at increased risk of UTIs and viral infections in the first year after KT. Interventional studies investigating the effect of Mg2+ supplementation on Mg2+ deficiency and viral infections in KTRs are needed.