More than 50% of world population lives in cities which emit almost 80% of global carbon emissions so cities are becoming focal points for low-carbon transformation and actions to mitigate climate change. With the policy objective of reducing greenhouse gas emissions in the power sector by 80 – 95% over the next 30 years, urban energy systems are at the center of these efforts. However, decarbonizing energy systems requires addressing simultaneously sectors that have been traditionally considered separately. The challenge is how to optimally integrate various energy streams at the distribution level with the aim of minimizing the overall carbon emissions of an urban area in a cost effective way. Distributed multi energy systems (DMES) can be a key enabling factor, defined as systems where various energy streams interact in an optimal manner with each other at the distribution grid level. They consist of distributed energy technologies and energy networks (thermal and electrical) that can be operated in either a centralized or decentralized manner. The introduction of distributed multi energy systems results in more complex systems to design and operate as it links separate energy supply sectors. With many degrees of freedom in such systems, it becomes impossible to manually find optimal solutions or even near-optimal solutions with any degree of certainty and an optimisation approach is needed to solve such complex problems. The challenge addressed in this work is how to develop such an optimization model to provide an effective means of solving the complex problem of optimal design and operation of DMES. In this thesis a holistic multi-objective optimisation model of distributed multi energy systems is developed to find optimal ways of transforming existing urban areas into low carbon ones. The model can simultaneously determine the optimal design and operation of DMES, the optimal district heating network layout and operation, the need for distribution grid upgrades, and the optimal operation so that the solutions are within grid limits (using calculations of AC power flow). The model is based on the coupling of an energy hub modelling approach for distributed energy systems design and operation, building energy simulations for obtaining heat and electrical demand profiles, an electrical grid model for power flow calculation of grid limits and upgrades, and a mathematical formulation for district heating network design and operation. The model can perform multi-objective optimisation of conflicting objectives of total cost and carbon emissions in order to give trade-offs between optimal solutions using a holistic approach that optimizes all part of the DMES simultaneously. These are usually considered separately and as a result can decrease the performance, miss good designs and can affect the stability of the electrical grid. The optimisation model is applied across a number of cases. Heat-related and electricity-related components of DMES are analysed separately to better understand the key influencing factors and underlying trends, followed by application to a large urban district with all components considered. The main research questions addressed are: should DMES be based on thermal or electrical distribution of energy, what are the differences between systems designed for existing buildings and future low energy buildings, is there a trade-off between installing a district heating network and upgrading the distribution grid to integrate more renewables, and what is the impact of different levels of renewable energy in the electricity supply when different energy roadmap goals are achieved. The results highlight the advantage of simultaneously optimising all components of DMES in order to decrease carbon emissions in a cost effective way. Moreover, the results reveal the importance of considering separate designs for supplying existing buildings and low energy buildings, which affects the district heating network potential and the need for grid upgrade when the heat system is electrified. Finally, the results show DMES are significantly affected by different renewable shares in the grid in terms of design, operation, district heating network potential and the need for grid upgrade. The findings can be used by policy makers and practitioners to deliver an effective transition to low carbon urban areas.