AbstractAchieving sustainable development goals (SDGs) announced by United Nations guarantees access to clean, affordable, and inexhaustible resources for all present and future human societies. Access to water and energy have always been two pillars of the SDGs. The use of renewable energy and nexus planning is among the essential strategies to achieve sustainable energy and water development while minimizing carbon emissions. Accordingly, this paper aims at proposing a method to access energy and water in line with SDGs targets, i.e., considering their linkage with carbon emission. This objective is addressed by proposing a mixed integer linear programming (MILP) model for a local community's water and energy resource planning based on energy–water–carbon nexus. To this end, initially, the relationship between the energy supply system, drinking water, and carbon pollution is modeled for a local community. Hybrid renewable energies and desalination are considered as the primary energy and water resources, respectively. The optimal size of the nexus components is then determined by considering the community demand with the minimum system cost and maintaining the permissible pollution. The simulations demonstrate nexus planning's superiority to achieve a more sustainable community in terms of affordability and pollution when supplying energy and water.