There were more than 100,000 fatal drug overdoses in the U.S. in 2021 alone. In recent years, there has been a shift in opioid mortality from predominantly White rural communities to Black urban communities. This study aimed to identify the Virginia communities disproportionately affected by the overdose crisis and to better understand the systemic factors contributing to disparities in opioid mortality. Using the state all-payer claims database, state mortality records, and census data, we created a multivariate model to examine the community-level factors contributing to racial disparities in opioid mortality. We used generalized linear mixed models to examine the associations between socioecologic factors and fatal opioid overdoses, opioid use disorder diagnoses, opioid-related emergency department visits, and mental health diagnoses. Between 2015 and 2020, racial disparities in mortality widened. In 2020, Black males were 1.5 times more likely to die of an opioid overdose than White males (47.3 vs 31.6 per 100,000; p<0.001). The rate of mental health disorders strongly correlated with mortality (β=0.53, p<0.001). Black individuals are not more likely to be diagnosed with opioid use disorder (β=0.01, p=0.002) or with mental health disorders (β= -0.12, p<0.001), despite higher fatal opioid overdoses. There are widening racial disparities in opioid mortality. Untreated mental health disorders are a major risk factor for opioid mortality. Findings show pathways to address inequities, including early linkage to care for mental health and opioid use disorders. This analysis shows the use of comprehensive socioecologic data to identify the precursors to fatal overdoses, which could allow earlier intervention and reallocation of resources in high-risk communities.