Recently identified palmitoylation of PD-L1 is essential for immune regulation. To elucidate the underlying molecular mechanism, we performed giant plasma membrane vesicle (GPMV) experiments, μs-scale all-atom molecular dynamics (MD) simulations, fluorescence resonance energy transfer (FRET) experiments, and immune killing experiments. GPMV experiments indicated that PD-L1 palmitoylation enhanced its lipid raft affinity. MD simulations revealed dramatically different membrane orientation states of PD-L1 in liquid-ordered (Lo, lipid raft) compared to liquid-disordered (Ld, nonraft) membrane environments, which was validated by FRET experiments. The Ld region promoted the "lie-down" orientation of PD-L1, which could inhibit its association with the PD-1 protein on immune cells and thus promote the immune killing of cancer cells. This hypothesis was supported by immune killing experiments using γδT cells as effector cells and NCI-H1299 lung cancer cells as target cells. In short, our study demonstrates that the palmitoylation affects PD-L1's membrane localization and then membrane orientation, which thus regulates its binding with T cell PD-1 and the immune regulation. These observations may guide therapeutic strategies by explicating the regulation of immune checkpoint proteins by post-translational modifications and membrane environments.