People living with HIV and opioid use disorder (OUD) are disproportionally affected by adverse socio-structural exposures negatively affecting health, which have shown inconsistent associations with uptake of medications for OUD (MOUD). This study aimed to determine whether social determinants of health (SDOH) were associated with MOUD uptake and trajectories of substance use in a clinical trial of people seeking treatment. Data are from a 2018 to 2019 randomized trial comparing the effectiveness of different MOUD to achieve viral suppression among people living with HIV and OUD. SDOH were defined by variables mapping to Healthy People 2030 domains: education (Education Access and Quality), income (Economic Stability), homelessness (Neighborhood and Built Environment), criminal justice involvement (Social and Community Context), and recent SUD care (Health Care Access and Quality). Associations between SDOH and MOUD initiation were assessed with Cox proportional hazards models, and SDOH and substance use over time with generalized estimating equation models. Participants (N = 114) averaged 47 years old, 63% were male, 56% were Black, and 12% Hispanic. Participants reported an average of 2.3 out of 5 positive SDOH indicators (SD = 1.2). Stable housing was the most commonly reported SDOH (61%), followed by no recent criminal justice involvement (59%), having a high-school level education or greater (56%), income stability (45%), and recent SUD care (13%). Each additional favorable SDOH was associated with a 25% increase in the likelihood of MOUD initiation during the study period [adjusted HR = 1.25, 95% CI = (1.01, 1.55), P = .044]. Positive SDOH were also associated with a decrease in the odds of baseline opioid use and a greater reduction in opioid use during subsequent weeks of the study (P < .001 for a joint test of baseline and slope differences). Positive social determinants of health, in aggregate, may increase the likelihood of MOUD treatment initiation among people living with HIV and OUD.