Sludge is a byproduct of wastewater processing suitable for biogas production. The biogas consisting of about 60% methane can be used to generate electricity and heat. A data-driven approach for optimization of biogas production process in a wastewater treatment plant is presented. The process model is developed using routinely collected data categorized as controllable and uncontrollable variables.