While decomposition of organic matter by bacteria plays a major role in nutrient cycling in terrestrial ecosystems, the significance of viruses remains poorly understood. Here we combined metagenomics and metatranscriptomics with temporal sampling to study the significance of mesophilic and thermophilic bacteria and their viruses on nutrient cycling during industrial-scale hyperthermophilic composting (HTC). Our results show that virus-bacteria density dynamics and activity are tightly coupled, where viruses specific to mesophilic and thermophilic bacteria track their host densities, triggering microbial community succession via top-down control during HTC. Moreover, viruses specific to mesophilic bacteria encoded and expressed several auxiliary metabolic genes (AMGs) linked to carbon cycling, impacting nutrient turnover alongside bacteria. Nutrient turnover correlated positively with virus–host ratio, indicative of a positive relationship between ecosystem functioning, viral abundances, and viral activity. These effects were predominantly driven by DNA viruses as most detected RNA viruses were associated with eukaryotes and not associated with nutrient cycling during the thermophilic phase of composting. Our findings suggest that DNA viruses could drive nutrient cycling during HTC by recycling bacterial biomass through cell lysis and by expressing key AMGs. Viruses could hence potentially be used as indicators of microbial ecosystem functioning to optimize productivity of biotechnological and agricultural systems.