Neuropathic cancer pain (NCP) is an important symptom in patients with cancer. However, significant analgesic tolerance and other side effects critically hamper the administration of morphine. Protein palmitoylation mediated by the DHHC family may be involved in the glial activation and inflammatory responses underlying organ failure. In this study, we investigated the key role of protein palmitoylation in cancer pain and sought to target palmitoylation to suppress morphine tolerance. We found that long-term use of morphine led to the accumulation of the morphine metabolite, morphine-3-glucuronide, in vivo and activated ERK1/2 and microglia to release inflammatory factors through the apelin receptor APLNR. Palmitoyltransferase ZDHHC9 was upregulated in NCP, and APLNR was palmitylated to protect it from lysosomal degradation and to maintain its stability. We also designed competitive inhibitors of APLNR palmitoylation to inhibit the development of NCP, release of inflammatory factors, and attenuation of morphine tolerance. Therefore, targeting APLNR palmitoylation in combination with morphine is a potent method for cancer pain treatment. Our data provide a basis for the future clinical use of related drugs combined with morphine for the treatment of cancer-related pain.