The opioid epidemic is an evolving health crisis in need of interventions that target all domains of maladaptive changes due to chronic use and abuse. Opioids are known for their effects on the opioid and dopaminergic systems, in addition to neurocircuitry changes that mediate changes in behavior; however, new research lines are looking at complementary changes in the brain and gut. The gut-brain axis (GBA) is a bidirectional signaling process that permits feedback between the brain and gut and is altered in subjects with opioid use disorders. In this work, we determine longitudinal, non-invasive, and in-vivo complementary changes in the brain and gut in rodents trained to self-administer morphine for two weeks using MRI and 16S rDNA analysis of fecal matter. We assess the changes occurring during both an acute phase (early in the self-administration process, after two days of self-administration) and a chronic phase (late in the self-administration process, after two weeks of self-administration), with all measurements benchmarked against baseline (naïve, non-drug state). Rats were surgically implanted with an intravenous jugular catheter for self-administration of morphine. Rats were allowed to choose between an active lever, which delivers a single infusion of morphine (0.4 mg/kg/infusion), or an inactive lever, which had no consequence upon pressing. Animals were scanned in a 7T MRI scanner three times (baseline, acute, and chronic), and before scanning, fecal matter was collected from each rat. After the last scan session, a subset of animals was euthanized, and brains were preserved for immunohistochemistry analysis. We found early changes in gut microbiota diversity and specific abundance as early as the acute phase that persisted into the chronic phase. In MRI, we identified alterations in diffusivity indices both within subjects and between groups, showing a main effect in the striatum, thalamus, and somatosensory cortex. Finally, immunohistochemistry analyses revealed increased neuroinflammatory markers in the thalamus of rats exposed to morphine. Overall, we demonstrate that morphine self-administration shapes the brain and gut microbiota. In conclusion, gut changes precede the anatomical effects observed in MRI features, with neuroinflammation emerging as a crucial link mediating communication between the gut and the brain. This highlights neuroinflammation as a potential target in addressing the impacts of opioid use.