Opioids are highly addictive substances with a relapse rate of over 90%. While preclinical models of chronic opioid exposure exist for studying opioid dependence, none recapitulate the relapses observed in human opioid addiction. The mechanisms associated with opioid dependence, the accompanying withdrawal symptoms, and the relapses that are often observed months or years after opioid dependence are poorly understood. Therefore, we developed a novel model of chronic opioid exposure whereby the level of administration is self-directed with periods of behavior acquisition, maintenance, and then extinction alternating with reinstatement. This profile arguably mirrors that seen in humans, with initial opioid use followed by alternating periods of abstinence and relapse. Recent evidence suggests that dietary interventions that reduce inflammation, including omega-3 polyunsaturated fatty acids (n-3 PUFAs), may reduce substance misuse liability. Using the self-directed intake model, we characterize the observed profile of opioid use and demonstrate that an n-3-PUFA-enriched diet ameliorates oxycodone-seeking behaviors in the absence of drug availability and reduces anxiety. Guided by the major role gut microbiota have on brain function, neuropathology, and anxiety, we profile the microbiome composition and the effects of chronic opioid exposure and n-3 PUFA supplementation. We demonstrate that the withdrawal of opioids led to a significant depletion in specific microbiota genera, whereas n-3 PUFA supplementation increased microbial richness, phylogenetic diversity, and evenness. Lastly, we examined the activation state of microglia in the striatum and found that n-3 PUFA supplementation reduced the basal activation state of microglia. These preclinical data suggest that a diet enriched in n-3 PUFAs could be used as a treatment to alleviate anxiety induced opioid-seeking behavior and relapse in human opioid addiction.