Anaerobic digestion is a biochemical process of decomposition of organic matter, mediated by anaerobic bacteria, in an oxygen-free environment, from which biogas is produced. Biogas is used to generate thermal and electrical energy, where environmental conditions such as pH, temperature, concentration of volatile fatty acids, have a great influence on the efficiency and performance of the anaerobic digestion process, and can cause the process to be ruined. This document presents a control strategy that seeks to regulate the conditions of the anaerobic digestion process to keep it within the stability zone, using a linearization technique of the model in the state space for the design of controllers. In this work, a compensator is designed, for which the approximate linearization technique of the AM2 nonlinear model is proposed, to obtain the linearized model from which a classic lag-lead control strategy is proposed, using the dilution rate as a control variable. As a result, an improvement in system performance is obtained by reducing the maximum overshoot and reducing the settling time, evaluated at the operating point, which is validated through simulation and analysis of the response provided by the nonlinear model at the point of operation.