This study elucidates the mechanism of the physiological effect of cannabidiol (CBD) by assessing its impact on lipopolysaccharide (LPS)-induced inflammation in RWPE-1 cells and prostatitis-induced by 17β-estradiol and dihydrotestosterone in a rat model, focusing on its therapeutic potential for chronic prostatitis/chronic pelvic pain syndrome (CP/CPPS). RWPE-1 cells were stratified in vitro into three groups: (1) controls, (2) cells with LPS-induced inflammation, and (3) cells with LPS-induced inflammation and treated with CBD. Enzyme-linked immunosorbent assays and western blots were performed on cellular components and supernatants after administration of CBD. Five groups of six Sprague-Dawley male rats were assigned: (1) control, (2) CP/CPPS, (3) CP/CPPS and treated with 50 mg/kg CBD, (4) CP/CPPS and treated with 100 mg/kg CBD, and (5) CP/CPPS and treated with 150 mg/kg CBD. Prostatitis was induced through administration of 17β-estradiol and dihydrotestosterone. After four weeks of CBD treatment, a pain index was evaluated, and prostate tissue was collected for subsequent histologic examination and western blot analysis. CBD demonstrated efficacy in vivo for CP/CPPS and in vitro for inflammation. It inhibited the toll-like receptor 4 (TLR4)/nuclear factor-kappa B (NF-κB) pathway by activating the CB2 receptor, reducing expression of interleukin-6, tumor necrosis factor-alpha, and cyclooxygenase-2 (COX2) (p<0.01). CBD exhibited analgesic effects by activating and desensitizing the TRPV1 receptor. CBD inhibits the TLR4/NF-κB pathway by activating the CB2 receptor, desensitizes the TRPV1 receptor, and decreases the release of COX2. This results in relief of inflammation and pain in patients with CP/CPPS, indicating CBD as a potential treatment for CP/CPPS.