Background: Liver transplantation (LT) is a routine therapeutic approach for patients with acute liver failure, end-stage liver disease and/or early-stage liver cancer. While 5-year survival rates have increased to over 80%, long-term outcomes are critically influenced by extrahepatic sequelae of LT and immunosuppressive therapy, including diabetes mellitus (DM). In this study, we used machine learning (ML) to predict the probability of new-onset DM following LT. Methods: A cohort of 216 LT patients was identified from the Disease Analyzer (DA) database (IQVIA) between 2005 and 2020. Three ML models comprising random forest (RF), logistic regression (LR), and eXtreme Gradient Boosting (XGBoost) were tested as predictors of new-onset DM within 12 months after LT. Results: 18 out of 216 LT patients (8.3%) were diagnosed with DM within 12 months after the index date. The performance of the RF model in predicting the development of DM was the highest (accuracy = 79.5%, AUC 77.5%). It correctly identified 75.0% of the DM patients and 80.0% of the non-DM patients in the testing dataset. In terms of predictive variables, patients’ age, frequency and time of proton pump inhibitor prescription as well as prescriptions of analgesics, immunosuppressants, vitamin D, and two antibiotic drugs (broad spectrum penicillins, fluocinolone) were identified. Conclusions: Pending external validation, our data suggest that ML models can be used to predict the occurrence of new-onset DM following LT. Such tools could help to identify LT patients at risk of unfavorable outcomes and to implement respective clinical strategies of prevention.