ZDHHC9 palmitoylates PD-L1 to maintain its protein stability and cell surface distribution, protecting cancer cells from the immune surveillance of T cells. Here, ZDHHC9 is linked to cancer.