Total knee arthroplasty (TKA) risks persistent pain and long-term opioid use (LTO). The role of social determinants of health (SDoH) in LTO is not well established. We hypothesized that SDoH would be associated with postsurgical LTO after controlling for relevant demographic and clinical variables. This study utilized data from the Veterans Affairs Surgical Quality Improvement Program, VA Corporate Data Warehouse, and Centers for Medicare and Medicaid Services, including Veterans aged ≥ 65 who underwent elective TKA between 2013 and 2019 with no postsurgical complications or history of significant opioid use. LTO was defined as > 90 days of opioid use beginning within 90 days postsurgery. SDoH variables included the Area Deprivation Index, rurality, and housing instability in the last 12 months identified via medical record screener or International Classification of Diseases, Tenth Revision codes. Multivariable risk adjustment models controlled for demographic and clinical characteristics. Of the 9,064 Veterans, 97% were male, 84.2% white, mean age was 70.6 years, 46.3% rural, 11.2% living in highly deprived areas, and 0.9% with a history of homelessness/housing instability. Only 3.7% (n = 336) developed LTO following TKA. In a logistic regression model of only SDoH variables, housing instability (odds ratio [OR] = 2.38, 95% confidence interval [CI]: 1.09–5.22) and rurality conferred significant risk for LTO. After adjusting for demographic and clinical variables, LTO was only associated with increasing days of opioid supply in the year prior to surgery (OR = 1.52, 95% CI: 1.43–1.63 per 30 days) and the initial opioid fill (OR = 1.07; 95% CI: 1.06–1.08 per day). Our primary hypothesis was not supported; however, our findings do suggest that patients with housing instability may present unique challenges for postoperative pain management and be at higher risk for LTO.