Background Recruitment of people to randomised trials of online interventions presents particular challenges and opportunities. The aim of this study was to evaluate factors associated with the recruitment of people with HIV (PWHIV) and their doctors to the HealthMap trial, a cluster randomised trial of an online self-management program. Methods: Recruitment involved a three-step process. Study sites were recruited, followed by doctors caring for PWHIV at study sites and finally PWHIV. Data were collected from study sites, doctors and patient participants. Factors associated with site enrolment and patient participant recruitment were investigated using regression models. Results: Thirteen study sites, 63 doctor participants and 728 patient participants were recruited to the study. Doctors having a prior relationship with the study investigators (odds ratio (OR) 13.3; 95% confidence interval (CI) 3.0, 58.7; P = 0.001) was positively associated with becoming a HealthMap site. Most patient participants successfully recruited to HealthMap (80%) had heard about the study from their HIV doctor. Patient enrolment was associated with the number of people with HIV receiving care at the site (β coefficient 0.10; 95% CI 0.04, 0.16; P = 0.004), but not with employing a clinic or research nurse to help recruit patients (β coefficient 55.9; 95% CI –2.55, 114.25; P = 0.06). Conclusion: Despite substantial investment in online promotion, a previous relationship with doctors was important for doctor recruitment, and doctors themselves were the most important source of patient recruitment to the HealthMap trial. Clinic-based recruitment strategies remain a critical component of trial recruitment, despite expanding opportunities to engage with online communities.