The effluent from a petroleum desalting unit contains salts, emulsifiers, hydrocarbons (mainly n‐dodecane), and other contaminants. Conventional wastewater treatment cannot be used to treat this salt‐containing effluent; thus, alternative approaches must be explored. In this study, a halo‐tolerant yeast, Debaryomyces hansenii, was investigated for the removal of varying concentrations of n‐dodecane in a simulated desalter effluent (SDE). Then, the removal of n‐dodecane was optimized using response surface methodology (RSM). The effects of pH, salt, temperature, and n‐dodecane concentration were evaluated, and a mathematical model was developed and verified. The results showed that complete removal of n‐dodecane was achieved at 20°C and a salt concentration of 1–5 g L−1. The main factors in COD removal are temperature, n‐dodecane concentration, pH, and the interaction between n‐dodecane and temperature. Salt concentration does not affect COD removal or the growth rate of D. hansenii in a SDE. Applying RSM suggested that interactional effects among the operational variables include temperature, n‐dodecane concentration, and pH on the yeast's removal rate. Overall, it can be concluded that the use of D. hansenii could be a viable solution at a wide range of salt concentrations (1–5 g L−1) for desalter wastewater treatment in petroleum refining.