A method of anaerobic digestion of acidic whey in a four-chamber system having anaerobic microorganisms for producing biogas comprising the steps of: injecting untreated acidic whey in the first chamber with organic loading rate 6- 7 kg VS/m 3. d, adjusting the temperature in the range of 37-38 °C and pH in the range of 4.2-4.5, thus providing the hydrolysis of acidic whey and the sedimentation of at least 90 wt% of milk proteins in the bulk liquid of acidic whey; separating the milk proteins sediment and 8-12 vol% of the bulk liquid and transferring them to the second chamber, adjusting the temperature in the range of 37-38 °C, pH in the range of 7.5-8.1 and hydraulic retention time in the range of 5-7 days, thus providing the treatment and partial anaerobic digestion of the milk proteins in the second chamber; transferring the remaining bulk liquid from the first chamber to the third chamber and adding the liquid of the treated milk proteins from the second chamber to the third chamber, adjusting in the said third chamber the temperature in the range of 37-38 °C, pH in the range of 6.6-7.2 and hydraulic retention time in the range of 3-4 days and adding nutrient solution and adding nitrogen source being partially provided from said treated milk proteins, thus providing mainly acetogenesis and methanogenesis processes in the third chamber; transferring effluent from the third chamber to the fourth chamber, adding nutrient solution and the source of nitrogen and adjusting in the said fourth chamber the temperature in the range of 37-38 °C, pH in the range of 7.2-7.8 and hydraulic retention time in the range of 3-4 days, thus providing mainly methanogenesis process in the fourth chamber; wherein, during all said steps biogas composition from each chamber is analyzed and collected. injecting untreated acidic whey in the first chamber with organic loading rate 6- 7 kg VS/m 3. d, adjusting the temperature in the range of 37-38 °C and pH in the range of 4.2-4.5, thus providing the hydrolysis of acidic whey and the sedimentation of at least 90 wt% of milk proteins in the bulk liquid of acidic whey; separating the milk proteins sediment and 8-12 vol% of the bulk liquid and transferring them to the second chamber, adjusting the temperature in the range of 37-38 °C, pH in the range of 7.5-8.1 and hydraulic retention time in the range of 5-7 days, thus providing the treatment and partial anaerobic digestion of the milk proteins in the second chamber; transferring the remaining bulk liquid from the first chamber to the third chamber and adding the liquid of the treated milk proteins from the second chamber to the third chamber, adjusting in the said third chamber the temperature in the range of 37-38 °C, pH in the range of 6.6-7.2 and hydraulic retention time in the range of 3-4 days and adding nutrient solution and adding nitrogen source being partially provided from said treated milk proteins, thus providing mainly acetogenesis and methanogenesis processes in the third chamber; transferring effluent from the third chamber to the fourth chamber, adding nutrient solution and the source of nitrogen and adjusting in the said fourth chamber the temperature in the range of 37-38 °C, pH in the range of 7.2-7.8 and hydraulic retention time in the range of 3-4 days, thus providing mainly methanogenesis process in the fourth chamber; wherein, during all said steps biogas composition from each chamber is analyzed and collected.