This study proposes a novel biomass gasification-based solid oxide fuel cell (SOFC) integrated with a gas turbine, a thermoelectric generator, a multi-stage flash desalination with brine recirculation unit (MSFBR), and a CO2 capture unit for power and freshwater production. Exergoeconomic and exergoenvironmental analyses of using four biomass fuels, namely, municipal solid waste (MSW), wood, paper, and sawdust on the newly proposed system are carried out. Subsequently, the thermodynamic performance, cost, and environmental impact (EI) indicators of the system are investigated under the varying substantial operating parameters for each selected biomass fuel. Then, the system performance is optimized based on the thermodynamic efficiencies, product cost, and EI of the overall system by applying the fast and elitist non-dominated sorting genetic algorithm (NSGA-II). The results exhibit that the highest produced freshwater and output power are achieved by 46.05 m(3)/day, and 228.7 kW for wood and sawdust, respectively, and the lowest levelized CO2 emission is achieved to be 0.138 ton/MWh for sawdust. Moreover, better total product cost and EI rate of the system are computed to be 2.106 $/h and 14.97 Pts/h, respectively, for MSW. Therefore, MSW is recognized as the best cost and environment-friendly fuel. (C) 2020 Institution of Chemical Engineers. Published by Elsevier B.V. All rights reserved.