Chronic pain remains one of the world’s most persistent and unsolved clinical challenges that severely affect patients’ quality of life. Presently, considering that the mechanisms underlying chronic pain are not fully understood, there is a lack of effective drugs and interventions to treat chronic pain in clinical practice. Therefore, exploring the pathogenic mechanism of chronic pain and establishing potential targets are the keys to treating chronic pain. Substantial evidence has indicated that gut microbiota plays a crucial role in modulating chronic pain, which has opened up a new frontier for investigating the pathogenesis of chronic pain. The gut microbiota is a pivotal junction point between the neuroimmune-endocrine and the microbiome-gut-brain axes that could directly or indirectly affect chronic pain. Different signaling molecules (such as metabolites, neuromodulators, neuropeptides, and neurotransmitters) from the gut microbiota regulate the progress of chronic pain by modulating the peripheral and central sensitization by targeting the corresponding receptors. Furthermore, gut microbiota dysbiosis is associated with the progress of different chronic pain disorders, such as visceral pain, neuropathic pain, inflammatory pain, migraine, and fibromyalgia. Therefore, the present review attempted to systematically summarize the action of the gut microbiota toward regulating the pathological mechanisms of chronic pain and discussed the beneficial effects of probiotics supplementation or fecal microbiota transplantation (FMT) to restore the gut microbiota in chronic pain patients so as to provide a new strategy for targeting the gut microbiota for alleviating chronic pain issues.