The escalating freshwater demand is stimulating the researchers to optimize the performance of desalination technologies. The current study presents the exergoeconomic optimization of a forward feed multi-effect desalination (FF-MED) system under two configurations i.e., conventional MED and MED with energy recovery (MED-ER). A detailed numerical model concerning energy, exergy, and a component-based exergoeconomic analysis is employed to estimate the energy consumption, exergy destruction, and water production cost. Thereafter, the FF-MED-ER system is optimized using a Genetic Algorithm for four different objective functions i.e., maximum gain output ratio (GOR), and minimum specific energy consumption (SEC), exergy destruction, and water production cost. The constraint variables included steam temperature, brine salinity, and the last effect brine temperature. The analysis showed that the incorporation of an energy recovery section increased GOR by 17.9% and decreased SEC and water production cost by 14%, and 10.5%, respectively. Moreover, the optimization improved GOR by 9.26%, decreased SEC by 12.86%, exergy destruction by 12.59%, and the water production cost by 8.25% compared to the standard nonoptimal system.