Background: Substance use disorders are a major risk factor for suicide. However, less is known about specific risk factors for suicide in people with substance use disorders. Methods: This population cohort study assessed suicide among people treated for drug use disorders in Denmark 2000-2010, and described risk factors for completed suicide. Data from 27,942 individuals enrolled in treatment were linked to national registers and matched with controls without drug use disorder and with (n = 138,136) or without psychiatric history (n = 1574). Competing risk regression was used to identify risk factors of completed suicide. Results: There were 163 suicides among patients with a history of drug treatment (0.6% of patients). Increased risk was associated with younger age at enrolment (hazard ratio [HR] = 0.97, 95% confidence interval (CI): 0.95, 0.98), history of psychiatric care (HR = 1.96, CI 95%: 1.39, 2.77), opioid use (HR = 1.81, 95% CI: 1.23, 2.68), and alcohol use (HR = 1.56, 95% CI: 1.09, 2.23). Lower risk was associated with cannabis use (HR = 0.69, 95% CI: 0.50, 0.96). Compared with age-and gender-matched controls without a history of treatment for substance use disorders or recent psychiatric care, the standardized mortality ratio due to suicide was 7.13 for people with drug use disorder without a history of psychiatric care (95% CI: 5.81, 8.44), 13.48 for people with drug use disorder and psychiatric history (95% CI: 9.75, 17.22), and 13.61 for people with psychiatric history only (95% CI: 6.72, 20.50). Conclusions: Risk of suicide is increased among people with drug use disorders. Access to treatment for comorbid mental health problems for people with drug use disorders could potentially reduce risk of suicide.