Nowadays ICT is becoming a key factor to enhance the energy optimization in our cities. At district level, real-time information can be accessed to monitor and control the energy distribution network. Moreover, the fine grain monitoring and control done at building level can provide additional information to develop more efficient control policies for energy distribution in the district. In this paper we present a distributed software infrastructure for district energy management, which aims to provide a digital archive of the city in which energetic information is available. Such information is considered as the input for a decision system, which aims to increase the energy efficiency by promoting local balancing and shaving peak loads. As case study, we integrated in our proposed cloud the heating distribution network in Turin and we present exploitable options based on real-world environmental data to increase the energy efficiency and minimize the peak request.