Morphine and its pharmacological derivatives are the most prescribed analgesics for moderate to severe pain management. However, chronic use of morphine reduces pathogen clearance and induces bacterial translocation across the gut barrier. The enteric microbiome has been shown to have a critical role in the preservation of the mucosal barrier function and metabolic homeostasis. Here, we show for the first time, using bacterial 16s rDNA sequencing, that chronic morphine treatment significantly alters the gut microbial composition and induces preferential expansion of Gram-positive pathogenic and reduction in bile-deconjugating bacterial strains. A significant reduction in both primary and secondary bile acid levels was seen in the gut, but not in the liver with morphine treatment. Morphine-induced microbial dysbiosis and gut barrier disruption was rescued by transplanting placebo-treated microbiota into morphine-treated animals, indicating that microbiome modulation could be exploited as a therapeutic strategy for patients using morphine for pain management.