In recent years, among the various treatment methods, the electrocoagulation process has been used for the treatment of effluents containing various dye pollutants. Sunset yellow (S.Y.) azo dye is one of the common food colors widely used in various food industries. This study investigated the removal of the dye S.Y. from aqueous media by the electrocoagulation method in an electrochemical reactor using concentric iron electrodes. The experiments were designed by the Response Surface Method (RSM) with the help of the Minitab software in such a way that the effect of various process-influencing parameters, such as current density, electrolysis time, electrolyte concentration, pH of the solution, and the effluent flow rate, on the desired pollutant removal efficiency was investigated. According to the results of the process optimization by RSM, the optimal conditions for the process were obtained as follows: pH of 10, current density of 2.65 mA/cm2, electrolysis time of 42.32 min, initial dye concentration of 20 mg/L, and effluent flow rate of 2.5 L/min. Under the above optimal conditions, the efficiency of dye removal was more than 99%.