The residential sector is facing challenges to reduce greenhouse gas (GHG) emissions, since its heat supply is largely based on fossil fuels. One way to accelerate the reduction process is seen in expanding energy planning from single buildings to groups of buildings, forming smart neighborhoods. This study presents a heat and power system optimization for a group of ten residential buildings located in a rural settlement in Germany. Thereby, a simulation platform is interlinked with an optimization model. Demand profiles, solar potentials and options of thermal refurbishment from the simulation platform serve as input data for the optimization model that considers numerous investment options for energy storage units and demand coverage.If costs of GHG emissions are considered in the optimization, a reduction of these emissions by about 60% compared to the status quo is cost-optimal. With regard to heat supply, the cost optimum is identified in the combination of decreasing heat demand through thermal refurbishments and covering the remaining demand mainly by heat from a combined heat and power (CHP) plant in addition with a wood-fired heating system. Therefore, the model results suggest to connect seven of the ten buildings via a local heating network. The demand for electricity is partly covered by the CHP plant, partly covered by solar generated electricity and partly covered by grid consumption.