ABSTRACT Many biochemical reactions occur at the membrane interfaces. The proper control of these reactions requires spatially and temporally controlled recruitment of protein complexes. These assemblies are largely regulated by post-translational modifications and a frequent one is S-acylation, which consists of the addition of medium length acyl chains. Reversibility of this modification is ensured by acyl protein thioesterases (APTs), which are poorly understood enzymes. Using a combination of computational, structural, biochemical, and cellular approaches, we dissect the mode of action of a major cellular thioesterase, APT2 (LYPLA2). We show that for APT2 to encounter its targets, it must interact with membranes by two consecutive steps, the insertion of a hydrophobic loop and subsequent S-acylation by the ZDHHC3 or ZDHHC7 palmitoyltransferases. Once bound, APT2 deforms the lipid bilayer to extract the acyl chain bound to its substrate, capturing it in a hydrophobic pocket and allowing hydrolysis. Deacylation releases APT2, allowing it to bind to other membranes, but also renders it vulnerable to ubiquitination and proteasomal degradation. This molecular understanding of APT2 paves the way to understand the dynamics of APT2-mediated depalmitoylation throughout the endomembrane system.