Indonesia has had low uptake of HIV testing and treatment. We did a study to estimate the cascade of HIV care in key populations and identify predictors of outcomes at key cascade steps. We used an observational cohort study design to recruit and follow up men who have sex with men (MSM), female sex workers, transgender women (known as waria in Indonesia), and people who inject drugs (PWID) diagnosed with HIV in four locations in Indonesia: Bali, Bandung, Jakarta, and Yogyakarta. Recruitment, baseline, and follow-up visits were done at collaborating clinical services, including both primary care sites and hospitals. Inclusion criteria for participants included identifying as a member of a key population, age 16 years or older, not previously tested positive for HIV, and HIV positivity at baseline. All participants were offered treatment as per national guidelines, with the addition of viral load testing and completion of study-specific forms. Estimates were calculated of proportions of participants linked to care, commencing treatment, adherent to treatment, and who achieved virological suppression. We used logistic regression to investigate characteristics associated with antiretroviral therapy (ART) initiation and viral suppression and Cox regression to identify factors associated with loss to follow-up. This study is registered with ClinicalTrials.gov, NCT03429842. Between Sept 15, 2015, and Sept 30, 2016, 831 individuals were enrolled in the study, comprising 637 (77%) MSM, 116 (14%) female sex workers, 27 (3%) waria, and 51 (6%) PWID. Of those enrolled, 703 (84·6%, 95% CI 82·1-87·1) were linked to HIV care and 606 (86·2%, 83·7-88·8) who were linked with care started ART. Among participants who started treatment, 457 (75·4%, 71·8-78·9) were retained in care, of whom 325 (71·1%, 66·7-75·2) had a viral load test about 6 months after enrolment, with 294 (90·5%, 86·7-93·4) of those tested (294 [35%, 32·1-38·7] of the original cohort) virally suppressed. 146 (24%) of 606 who started treatment were lost to follow-up. People who enrolled at sites that offered both testing and treatment had a higher likelihood of treatment initiation than those who enrolled at sites offering testing only (p<0·0001 by multivariate analysis), and participants who had been linked to care and had a high school or university education were significantly more likely to achieve viral suppression than those with a primary school or lower level of education (p≤0·029 by mulivariate analysis). HIV cascade data among key populations in Indonesia show very poor rates of retention in treatment and viral suppression. Site and individual characteristics associated with initiating and continuing treatment suggest an urgent need to develop and implement effective interventions to support patients in achieving viral suppression among all people with HIV. Australian Government Department of Foreign Affairs and Trade, WHO, and Indonesian Government.