Diabetes and chronic kidney disease (CKD) are associated with a higher rate of complications in patients undergoing total knee arthroplasty (TKA). The purpose of this study was to determine the effects of CKD and diabetes in patients after TKA. Diabetic patients who received unilateral primary TKA between January 2008 and December 2011 were enrolled. The follow-up period was more than 6 months. The primary outcome was a TKA-related infection and the secondary outcome was all-cause mortality. The study cohort included 13844 patients who were followed for a mean period of 2 years, of whom 1459 (10.5%) had CKD. The patients with CKD were older than those without CKD (71.6 versus 70.3 years, P<0.0001) and had higher rates of hypertension, gouty arthritis, ischemic heart disease, chronic pulmonary obstructive disease, pulmonary embolism and deep vein thrombosis (all P<0.0001). After adjustment of comorbidities, the CKD group had a higher incidence of urinary tract infections (OR: 1.61, 95% CI: 1.19-2.17). There were no significant differences in wound infections, pneumonia, pulmonary embolism or in-hospital death between the two groups. After adjustment of confounders, the CKD group had higher rates of myocardial infarction (HR: 2.06, 95% CI: 1.26–3.39) and mortality (HR: 1.99, 95% CI: 1.59–2.48). The risk of TKA-related infection during follow-up was comparable between the two groups (HR: 1.31, 95% CI: 0.94–1.82). In conclusion, CKD is associated with increased risks of urinary tract infections, myocardial infarction and all-cause mortality after TKA. Surgeons should be aware of this when evaluating TKA patients with renal disease.