District Heating (DH) systems enable the integration of renewable energy sources and are ideally suited for measures to increase flexibility with respect to renewable energy sources, advanced operating strategies, and the use of thermal storage. These benefits could be further enhanced if system-wide and holistic approaches, as well as scientific methods such as simulation and optimization, were applied during design, implementation, and operation. For the implementation of flexible and sustainable hot water systems, further research and demonstration work is needed on flexibility measures such as heat storage, heat pumps, smart control, sector coupling with electricity and wastewater infrastructure in combination with a higher share of renewable heat and holistic system and planning approaches. Thermaflex addresses these research needs based on several demonstration cases. Based on the demonstrators "100% renewable district heating Leibnitz", "Big Solar Salzburg", "Salzburg Absorption Heat Pump", "Virtual Heating Plant Gleisdorf", "Viennese High Temperature Heat Pump Spittelau", "Viennese Waste Heat Utilization from Waste Water" and "Energy Island Weiz", the developed concepts are presented, validated, optimized and best-practice criteria derived.