Cysteine palmitoylation or S-palmitoylation catalyzed by the ZDHHC family of acyltransferases regulates the biological function of numerous mammalian proteins as well as viral proteins. However, understanding of the role of S-palmitoylation in antiviral immunity against RNA viruses remains very limited. The adaptor protein MAVS forms functionally essential prion-like aggregates upon activation by viral RNA-sensing RIG-I-like receptors. Here, we identify that MAVS, a C-terminal tail-anchored mitochondrial outer membrane protein, is S-palmitoylated by ZDHHC7 at Cys508, a residue adjacent to the tail-anchor transmembrane helix. Using superresolution microscopy and other biochemical techniques, we found that the mitochondrial localization of MAVS at resting state mainly depends on its transmembrane tail-anchor, without regulation by Cys508 S-palmitoylation. However, upon viral infection, MAVS S-palmitoylation stabilizes its aggregation on the mitochondrial outer membrane and thus promotes subsequent propagation of antiviral signaling. We further show that inhibition of MAVS S-palmitoylation increases the host susceptibility to RNA virus infection, highlighting the importance of S-palmitoylation in the antiviral innate immunity. Also, our results indicate ZDHHC7 as a potential therapeutic target for MAVS-related autoimmune diseases.