Colorectal cancer is one of the most common malignancies in the Western world, and even after surgical removal, there is a high recurrence rate. Metformin treatment has been associated with a reduced risk of developing cancer, but whether metformin influences the risk of recurrence is unknown. The aim of our study was to examine the association between treatment with metformin and recurrence-free, disease-free survival and all-cause mortality after surgery for colorectal cancer. The study was an observational register-based study and included 25,785 patients, of which 1,116 had medically treated diabetes and 966 started metformin treatment at some point postoperatively. Diabetes was not associated with neither disease-free (HRadjusted = 1.09, 95% CI 0.97–1.21, p = 0.15) nor recurrence-free survival (HRadjusted = 1.13, 95% CI 0.95–1.35, p = 0.17). The study found no difference in regards to disease-free or recurrence-free survival between the metformin treated group (HRRFS = 1.06, 95% CI 0.87–1.15, p = 0.57, HRDFS = 1.01, 95% CI 0.89–1.15, p = 0.85) and non-diabetic patients. Patients with diabetes had increased all-cause mortality (HRadjusted = 1.29, 95% CI 1.16–1.45, p < 0.0001). Metformin treatment did not affect all-cause mortality (HR = 1.07, 95% CI 0.94–1.22, p = 0.33) compared to non-diabetic patients. In conclusion, our study did not find an association between diabetes or metformin treatment and recurrence-free or disease-free survival after surgery for colorectal cancer. However, diagnosis of diabetes is associated with increased all-cause mortality.