Plants increasingly exploit high geothermal energy potentials in German district heating networks. Municipal planners need instruments to design the district heating network for geothermal heat. This paper presents a combinatorial mixed-integer linear optimisation model and a three-stage heuristic to determine the minimum-cost district heating systems in municipalities. The central innovations are the ability to optimise both the structure of the heating network and the location of the heating plant, the consideration of partial heat supply from district heating and the scalability to larger municipalities. A comparison of optimisation and heuristic for three exemplary municipalities demonstrates the efficiency of the latter: the optimisation takes between 500% and 1 × 107% more time than the heuristic. The deviations of the heuristic's calculated total investments for the district heating system compared to the optimisation are in all cases below 5%, and in 80% of cases below 0.3%. The efficiency of the heuristic is further demonstrated by comparison with the Nearest-Neighbour-Heuristic, which is less efficient and substantially overestimates the total costs by up to 80%. ... mehrThe heuristic can also be used to design district heating networks in holistic energy system optimisations due to the novel possibility of connecting an arbitrary number of buildings to the network. Future work should focus on a more precise consideration of heat losses, as well as taking additional geological and topographical conditions into account.