In this paper, the results of the energy renovation of a residential building, aimed at introducing it into a Renewable Energy Community (CER), are presented. A case study located in Florence (Italy) is discussed. Static and dynamic energy models have been used to evaluate the energy performance of the building, to compare different scenarios based on heat pumps (independent or centralised generator) and to evaluate them under the perspective of EPBD parameters. A comparison has been made concerning energy consumption and CO2 emissions. In its current state, the building presents an energy performance index of 129.8 kWh/(m2year) (class D). The energy refurbishment with heat pump (A4, 24.7 kWh/(m2year)) and VMC system (A4, 39.3 kWh/(m2year)) ensures a strong reduction in CO2 emissions, respectively 5.5 kg/(m2year) and 8.7 kg/(m2year) against 24.4 kg/(m2year) with the current gas fired boiler. The centralized heat pump configuration allows to further reduce the energy consumption. With the same thermal energy requirement, the results show a reduction of 14% of the power needs (without total recovery), thanks to the better sizing of the generator. Furthermore, the centralized heat pump opens a perspective of direct self-consumption of the energy product by the photovoltaic system into a CER configuration. The paper shows that the energy renovation with a heat pump is an effective way to reach the EPBD objectives and decarbonize the residential heating and cooling sector.