Biogas, obtained from the anaerobic digestion of animal waste, is being increasingly used worldwide, and is generating significant economic and environmental benefits. It is ideal for regions that are mainly involved in agricultural activities and animal husbandry. Thus, the objective of this study was to estimate the energy potential and to optimize the allocation of electric power generation plants that use biogas in the mesoregions of Minas Gerais, Brazil, based on the distribution generation standards and availability of resources. To calculate the energy potential, data from governmental platforms were used, referring to the number of animals in the study regions as well as theoretical conversion models in the literature. To optimize the allocation of biogas plants, QGis software and a constructive algorithm that was developed for this study were used to build maps that demonstrated the optimal allocation of these plants, based on their potential and geographical location. To convert biomethane into electricity using a combustion engine (28% efficiency), energy potentials of 791.8 and 218.3 GWh yr−1 and 21 and 6 plants located in Zona da Mata and Campo das Vertentes, respectively, were estimated. With respect to the combine cycle (65% efficiency), energy potentials of 1838.2 and 506.7 GWh yr−1 and 47 and 14 plants in Zona da Mata and Campo das Vertentes, respectively, were estimated. New plants were calculated to increase the energy generation in the evaluated regions by 8–19%. The average cost of energy generation using stationary engine and combined cycle were USD 0.2384 kWh−1 and USD 0.0974 kWh−1, respectively. A reduction in CO2 emissions per inhabitant is expected for the assessed region, ranging between 6.05% and 14.52%. A significant portion of the state's rural electricity consumption could be supported by these new ventures, leading to an increase in energy security as well as reliability in meeting demand. In addition, the developed optimization algorithm can be used as a decision-making tool to determine locations for the construction of biogas plants in other regions of Brazil.