In Finland district heating accounts for almost half of the total heating market and over 70 % of the district heat is produced with combined heat and power (CHP) plants. Energy and climate policies aim especially to increase the share of renewable energy in the future energy systems. Large shares of variable power generation will increase the volatility in electricity prices that in turn will impact CHP production as well as heat production with heat pumps. As a consequence thermal energy storages and heat pumps could have an increasingly important role in future district heating (DH) networks. The paper explores the optimal dimensioning of heat storages, heat pumps and solar collectors. In order to do this, we perform the optimal hourly scheduling of heat production and storage in the DH network of Järvenpää and Tuusula (78,000 inhabitants) in Southern Finland in 2050. These results are used to find the most cost effective combinations of the aforementioned district heating technologies. The studied DH network includes both CHP plant, fired mainly by biomass and heat only boilers. As future electricity prices are highly sensitive to the future shares of wind power and PV, we study three different scenarios with varying shares of wind power and PV (40% and 60%) in 2050. When the impacts of different system components were analyzed separately, it was found that a small heat storage is not a profitable investment but a larger heat storage (100,000 - 110,000 m3) is economical. In addition, the results indicate that the most economical size for a heat pump is around 20 – 25 MW. Yet, the most profitable solution was to include both a heat storage and a heat pump in the DH system. According to our results, solar collector was not a profitable investment in the studied DH system.