A nonlinear model predictive controller for the anaerobic digestion of readily biodegradable substrates is presented. The controller aims to achieve a planned methane production, following a reference trajectory for the whole operation. Using an existing dynamic model of anaerobic digestion, the controller optimizes the operation conditions by conveniently manipulating a set of process variables such that the methane flow rate follows the reference trajectory. The controller works in a sequential approach, i.e., the plant trajectory is estimated over a prediction horizon with a simplified dynamic model of the process that includes only two biological reactions: acidogenesis and methanogenesis; then, the model predictions are optimized via a sequential quadratic programming method to match the desired trajectory. Due to the simplicity of the process model, the iterative optimization process is solved in a relatively short time. Both the dynamic model of the process and the optimization algorithm are implemented in MATLAB. The controller is tested in a simulation case study treating a readily biodegradable liquid effluent, where the same process model is used to mimic the measurements of the real plant.