Cancer-induced bone pain (CIBP) is one of the most common and feared symptoms in patients with advanced tumors. The X-C motif chemokine ligand 12 (CXCL12) and the CXCR4 receptor have been associated with glial cell activation in bone cancer pain. Moreover, mitogen-activated protein kinases (MAPKs), as downstream CXCL12/CXCR4 signals, and c-Jun, as activator protein AP-1 components, contribute to the development of various types of pain. However, the specific CIBP mechanisms remain unknown. Esketamine is a non-selective N-methyl-d-aspartic acid receptor (NMDA) inhibitor commonly used as an analgesic in the clinic, but its analgesic mechanism in bone cancer pain remains unclear. We used a tumor cell implantation (TCI) model and explored that CXCL12/CXCR4, p-MAPKs, and p-c-Jun were stably up-regulated in the spinal cord. Immunofluorescence images showed activated microglia in the spinal cord on day 14 after TCI and co-expression of CXCL12/CXCR4, p-MAPKs (p-JNK, p-ERK, p-p38 MAPK), and p-c-Jun in microglia. Intrathecal injection of the CXCR4 inhibitor AMD3100 reduced JNK and c-Jun phosphorylations, and intrathecal injection of the JNK inhibitor SP600125 and esketamine also alleviated TCI-induced pain and reduced the expression of p-JNK and p-c-Jun in microglia. Overall, our data suggest that the CXCL12/CXCR4-JNK-c-Jun signaling pathway of microglia in the spinal cord mediates neuronal sensitization and pain hypersensitivity in cancer-induced bone pain and that esketamine exerts its analgesic effect by inhibiting the JNK-c-Jun pathway.