Scientific investigations show that multi-generation via wise and purposive integration of energy system components could be significantly effective for better economic feasibility as well as efficiency and reliability of supply by renewable sources. Considering this fact and taking into account energy, economic, and environmental factors, this study provides the best possible setup of a novel combined cooling, heating, power, and water (CCHPW) system for coastal areas by employing response surface methodology (RSM) and TRNSYS simulation. This multi-component multi-generation system comprises photovoltaic/thermal (PV/T) collectors, a heat pump, a desiccant wheel, fuel cells, a reverse osmosis system, a battery, and a hydrogen storage unit. The system is dynamically simulated in the TRNSYS environment. The impacts of the selected design parameters on the techno-economic-environmental performances of the system are investigated after the RSM identifies the ideal configuration. The results for the weather conditions and consumption patterns of Dubai and Barcelona (as the two case studies) indicate that the total electricity consumption of the system can be reduced by 72.3% and 64.6% compared to the base system, respectively. Besides, the total environmental damage of the system is diminished by 29.2% for Dubai and 8.1% for Barcelona compared to the base system. Overall findings reveal that accounting for energy, economic and environmental aspects of the CCHPW system can improve the decision-making process.