Viruses manipulate bacterial community composition and impact wastewater treatment efficiency. Some viruses pose threats to the environment and human populations through infection. Improving the efficiency of wastewater treatment and ensuring the health of the effluent and receptor pools requires an understanding of how viral communities assemble and interact with hosts in wastewater treatment plants (WWTPs). We used metagenomic analysis to study the distribution, assembly mechanism, and sensitive hosts for the viral communities in raw water, anaerobic tanks, and returned activated sludge units of a large-scale industrial park WWTP. Uroviricota (53.42% ± 0.14%) and Nucleocytoviricota (26.1% ± 0.19%) were dominant in all units. Viral community composition significantly differed between units, as measured by β diversity (P = 0.005). Compared to raw water, the relative viral abundance decreased by 29.8% in the anaerobic tank but increased by 9.9% in the activated sludge. Viral community assembly in raw water and anaerobic tanks was predominantly driven by deterministic processes (MST <0.5) versus stochastic processes (MST >0.5) in the activated sludge, indicating that differences in diffusion limits may fundamentally alter the assembly mechanisms of viral communities between the solid and liquid-phase environments. Acidobacteria was identified as the sensitive host contributing to viral abundance, exhibiting strong interactions and a mutual dependence (degree = 59). These results demonstrate the occurrence and prevalence of viruses in WWTPs, their different assembly mechanism, and sensitive hosts. These observations require further study of the mechanisms of viral community succession, ecological function, and roles in the successive wastewater treatment units.