Opioid use for long-term pain management is limited by adverse side effects, such as hyperalgesia and negative affect. Neuroinflammation in the brain and spinal cord is a contributing factor to the development of symptoms associated with chronic opioid use. Recent studies have described a link between neuroinflammation and behavior that is mediated by a gut-brain signaling axis, where alterations in indigenous gut bacteria contribute to several inflammation-related psychopathologies. As opioid receptors are highly expressed within the digestive tract and opioids influence gut motility, we hypothesized that systemic opioid treatment will impact the composition of the gut microbiota. Here, we explored how opioid treatments, and cessation, impacts the mouse gut microbiome and whether opioid-induced changes in the gut microbiota influences inflammation-driven hyperalgesia and impaired reward behavior. Male C57Bl6/J mice were treated with either intermittent or sustained morphine. Using 16S rDNA sequencing, we describe changes in gut microbiota composition following different morphine regimens. Manipulation of the gut microbiome was used to assess the causal relationship between the gut microbiome and opioid-dependent behaviors. Intermittent, but not sustained, morphine treatment was associated with microglial activation, hyperalgesia, and impaired reward response. Depletion of the gut microbiota via antibiotic treatment surprisingly recapitulated neuroinflammation and sequelae, including reduced opioid analgesic potency and impaired cocaine reward following intermittent morphine treatment. Colonization of antibiotic-treated mice with a control microbiota restored microglial activation state and behaviors. Our findings suggest that differing opioid regimens uniquely influence the gut microbiome that is causally related to behaviors associated with opioid dependence.