With the escalating global population, freshwater scarcity has become a pressing challenge. To address this issue, this paper presents a novel compact solar water heater (CSWHT) system incorporating heat recovery and submerged-membrane filtration. The research aims to develop an efficient desalination method that reduces water production costs and maximizes output. The system comprises a feed storage tank, a vacuum membrane distillation (VMD) system positioned atop the submerged CSWHT, a liquid ring vacuum pump (LRVP) utilizing waste heat from the outlet to preheat the feed, and hollow fiber membranes.Three critical parameters, namely the mass of the feed in the storage tank, the number of hollow fiber membrane rows, and the feed volumetric flow rate, were optimized using a multi-objective non-dominated sorting genetic algorithm II (NSGA II) to minimize water production cost (WPC) while maximizing water production. Subsequently, the Technique for Order of Preference by Similarity to Ideal Solution (TOPSIS) was employed to identify the optimal scenario from among the selected best solutions.For Mediterranean seawater and a 6 m2 solar collector area, the multi-objective NSGA II algorithm identified 20 membrane rows per collector, 334.4 kg feed mass in the storage tank, and 0.027 kg.s−1 feed mass flow rate as the optimal system parameters. Under these optimized conditions, the system exhibited a daily production capacity of 92.5 kg water, 4.6 kg chloride, and 0.03 g bromide, while achieving a production cost of 12.2 USD.m−3 and a gain output ratio (GOR) of 1.6. These results highlight the system's remarkable potential for desalination with high efficiency and low cost. Future research should focus on scaling up the system and exploring its applicability in various geographical locations.