In thesis we presented the procedure of optimisation of a nearly zero-energy multi-family house with the help of a specially designed software for dynamic simulations called IDA Indoor Climate Energy. We wanted to show how to achieve the optimized building envelope with gradual elimination of different variants of buildings' envelope. Building envelope variants differ from one another in the thermal transmittance of outer walls, roof, type of glazing and airtightness. First, we analyzed and compared the use of energy for heating and cooling and primary energy. Analyzes of these aforementioned measures showed that airtightness has the greatest impact, followed by a change in glazing. The aim was also to optimize the building envelope from an economic standpoint, which is why we performed a Life-cycle cost analysis of the building. The latter has shown that high investments in thermal envelope are not always rational. We explored the importance of the appropriate distribution of glazing according to the facade orientation. It turns out that with the combination of two-layer windows with a higher solar energy transmittance factor, positioned on the southern facade and with three-layer windows on the remaining facades, the best results are achieved. In addition, we checked the illumination of rooms, which in general proved to be good, and the parameters of thermal comfort, which were met in a sufficient manner. With a simple software tool we managed to analyze systems for supplying buildings and settlement with energy. The thesis demonstrates the importance of taking a gradual approach in building design and use of dynamic simulation tools, while also draws attention to incomplete legislation, currently effect in this field.