Biogas production from agricultural and industrial wastes delivers two benefits: on one side, the treatment of organic residues prevents the environmental and economic impact of their disposal; on the other side, methane and/or hydrogen are generated. The aims of this study were both to produce bio-hydrogen from buffalo wastes and to investigate the relationship between biogas production and bacterial and archaeal community composition. Anaerobic codigestion of livestock by-products (buffalo sludge and low protein cheese whey-scotta), with buffalo rumen and buffalo sludge as inoculum, was performed. The microbial community was analyzed using next-generation sequencing of 16S rRNA gene amplicons. Codigestion showed to be positive because of both sludge buffering capability and highly degradable carbohydrates content in scotta. Rumen inoculum proved more efficient compared to sludge during fermentation. In fact, cumulated production was higher (120.8 vs. 65.4 ml H 2 g VS −1 respectively) and the average percentage of hydrogen in biogas was 48.1 (v/v) with maximum peak at 64.6. Moreover, rumen bacterial profile showed higher genera richness. Taxonomic classification showed that among the bacteria, Firmicutes, 23.3% of whom Clostridia; Bacteroidetes, and in particular Bacteroidia; Proteobacteria and Tenericutes, accounted for 88.2% of total sequences. Concerning the Clostridia Family XIII, the C. Incertae Sedis was the most represented (6.6%), and its quantity was twice as much in rumen inoculated hydrogen-producing samples than those non-producing. In the archaeal, community predominated the phylum Euryarcheota, with Methanobrevibacter the most represented, which was higher when hydrogen was produced with rumen inoculum. Studies on buffalo rumen as inoculum for hydrogen production are limited and this paper gives a first overview of microbial community composition by NGS in producing and non-producing samples.