The aim was to determine if opioid neuroimmunopharmacology pathway gene polymorphisms alter serum morphine, morphine-3-glucuronide and morphine-6-glucuronide concentration-response relationships in 506 cancer patients receiving controlled-release oral morphine. Morphine-3-glucuronide concentrations (standardised to 11 h post-dose) were higher in patients without pain control (median (interquartile range) 1.2 (0.7–2.3) versus 1.0 (0.5–1.9) μM, P = 0.006), whereas morphine concentrations were higher in patients with cognitive dysfunction (40 (20–81) versus 29 (14–60) nM, P = 0.02). TLR2 rs3804100 variant carriers had reduced odds (adjusted odds ratio (95% confidence interval) 0.42 (0.22–0.82), P = 0.01) of opioid adverse events. IL2 rs2069762 G/G (0.20 (0.06-0.52)), BDNF rs6265 A/A (0.15 (0.02–0.63)) and IL6R rs8192284 carrier (0.55 (0.34–0.90)) genotypes had decreased, and IL6 rs10499563 C/C increased (3.3 (1.2–9.3)), odds of sickness response (P ≤ 0.02). The study has limitations in heterogeneity in doses, sampling times and diagnoses but still suggests that pharmacokinetics and immune genetics co-contribute to morphine pain control and adverse effects in cancer patients.