The management of visceral pain in patients with disorders of gut-brain interaction, notably irritable bowel syndrome, presents a considerable clinical challenge, with few available treatment options. Patients are increasingly using cannabis and cannabinoids to control abdominal pain. Cannabis acts on receptors of the endocannabinoid system, an endogenous system of lipid mediators that regulates gastrointestinal function and pain processing pathways in health and disease. The endocannabinoid system represents a logical molecular therapeutic target for the treatment of pain in irritable bowel syndrome. Here, we review the physiological and pathophysiological functions of the endocannabinoid system with a focus on the peripheral and central regulation of gastrointestinal function and visceral nociception. We address the use of cannabinoids in pain management, comparing them to other treatment modalities, including opioids and neuromodulators. Finally, we discuss emerging therapeutic candidates targeting the endocannabinoid system for the treatment of pain in irritable bowel syndrome.