This research investigates a framework for the development of a renewable-based district heating energy system model. In this study, operation and planning have been done to select suitable areas for district heating based on renewable energy resources in the Gaziantep region of Turkey. In the first step, Boolean and fuzzy tools are employed to analyze different information layers in the ArcGIS software platform. Then, the Analytic Hierarchy Process (AHP) is used to determine the weights of the indicators. Finally, the output of these studies is used to identify suitable areas to construct district heating structure and supply energy optimally. Furthermore, the forecasting of heating demand for the year 2030 is carried out using collected historical data. the proposed energy systems is modeled based on the Mixed Integer Linear Programming (MILP), with the main objective of minimizing the Levelized Cost of Energy (LCOE) and techno-economic constrains. According to the potential of renewable resources in the region, this study examines a hybrid energy system that includes solar thermal energy, photovoltaic (PV), wind turbines, and heat pumps to assign the optimal capacity, energy production, and operation of each component. The results indicate that approximately 270 square kilometers of this area are suitable for implementing fourth-generation district heating systems. The best energy combination for reducing costs and protecting the environment in urban areas should be based on the available renewable resources in the region. Heat pumps in district heating systems can play an important role in optimizing the use of renewable resources and reducing fossil fuel consumption due to their coefficient of performance and energy cost reduction. By using a combination of heat pumps and other renewable sources, the efficiency of district heating systems can be improved, leading to energy cost reduction on an urban scale. The energy consumption for district heating in 2030, according to the forecasted scenario, will be approximately 1725 gigawatt-hours. According to the numerical results obtained, the hybrid energy system including single-axis solar trackers, heat pumps, and solar thermal collectors has the lowest LCOE of 0.058 dollars per kilowatt-hour. In this energy system, the installed capacity of PV systems and wind turbines is 45 and 7.3 megawatts, respectively. Furthermore, by considering different environmental scenarios in different energy systems, carbon emissions are projected to be about 6.5% higher in 2023 compared to 2020.