A growing number of German municipalities are striving for energy autonomy. Geothermal plants are increasingly constructed in municipalities in order to exploit the high hydrothermal potential. This paper analyses the potential contribution of simultaneous geothermal power and heat generation in German municipalities to achieving energy autonomy. A linear regression estimates the achievable hydrothermal temperatures and the required drilling depths. Technical restrictions and cost estimations for geothermal plants are implemented within an existing linear optimisation model for municipal energy systems. Novel modelling approaches, such as optimisation with variable drilling depths, are developed. The new approach is validated with data from existing geothermal plants in Germany, demonstrating a Root Mean Squared Error of about 15%. Eleven scenarios show that achieving energy autonomy is associated with at least 4% additional costs, compared to scenarios without it. The crucial role of geothermal plants in providing base load heat and power to achieve energy autonomy is demonstrated. The importance of simultaneous modelling of electricity and heat generation in geothermal plants is also evident, as district heating plants reduce the costs, especially in municipalities with high hydrothermal potential. Further work should focus on the optimal spatial scale of the system boundaries and the impact of the temporal resolution of the analysis on the costs for achieving energy autonomy.