Sewage sludge from wastewater treatment plants is often used for energy generation with biogas production. Whey is a waste product of the diary industry rich with carbohydrates, proteins and lipids, but it is problematic as a substrate for the biogas production due to low alkalinity and pH. Aim of the study was to determine the maximum quantity of whey in-to the biogas digester, which still allows the stable process and to determine the effect of added whey to the composition of microbial communities. The study was carried out 238 days in two 200-L pilot digesters at the Central wastewater treatment plant Domžale-Kamnik at mesophilic conditions (39 °C). A mixture of primary and secondary sludge was added to both digesters daily and a different amount of whey was added to the experimental digester (from 0.5 to 2.75 % of the digester working volume). We measured pH, alkalinity, VFAs, COD, total and volatile solids, ammonium and Kjeldahl nitrogen, biogas composition and shifts within microbial communities. The whey addition to the experimental digester did not have a significant effect on the pH, COD, total and volatile solids, biogas composition and VFAs. However, the influence of the dilution factor on alkalinity, ammonium and Kjeldahl nitrogen is noticable. Daily biogas production in the experimental digester was higher than in the control digester. The analysis of changes in microbial communities showed a greater shift in archaeal as in bacterial community.