The energy and electrode costs are the restrictions of applying electrocoagulation (EC) in wastewater treatment and many attempts have been made to decrease these costs. In this study, an economical EC was investigated to treat a hazardous anionic azo dye wastewater (DW) that threatens the environment and human health. Firstly, an electrode for EC process was produced from recycled aluminum cans (RACs) by remelting in an induction melting furnace. The performance of the RAC electrodes in the EC was evaluated for COD, color removal, and the EC operating parameters such as initial pH, current density (CD), and electrolysis time. Response surface methodology which is based on central composite design (RSM-CCD) was used for the optimization of the process parameters which were found to be pH 3.96, CD 15mA/cm2, and electrolysis time 45min. The maximum COD and color removal values were determined as 98.87% and 99.07%, respectively. The characterization of electrodes and the EC sludge was conducted by XRD, SEM, and EDS analyses for the optimum variables. In addition, the corrosion test was conducted to determine the theoretical lifetime of the electrodes. The results showed that the RAC electrodes show an extended lifetime as compared to their counterparts. Secondly, the energy cost required to treat DW in the EC was aimed to decrease by using solar panels (PV), and the optimum number of PV for the EC was determined by the MATLAB/Simulink. Consequently, the EC with low treatment cost was proposed for the treatment of DW. An economical and efficient EC process for waste management and energy policies was investigated in the present study which will be instrumental in the emergence of new understandings.