The influence of biotic and abiotic factors on viral communities across environmental gradients in soil is relatively unknown. While soil pH strongly influences microbial community structure, it is unclear whether there is a similar influence on soil viruses. In this study, prokaryotic and viral communities were characterized in soils from a long-term pH-manipulated soil gradient (pH 4.5 and 7.5), and viral populations also compared to those of other soils ranging in pH (4.0–7.5). Viral communities were significantly influenced by pH at the local scale with 99% of viral operational taxonomic units restricted to pH 4.5 or 7.5 soil only. Analysis of viromes from six other European and North American soil systems demonstrated that a selection of viral clusters from acidic and neutral pH soils were more associated with those from the local gradient pH 4.5 or 7.5 soils, respectively. While direct pH effects on virion integrity and indirect selection via host composition were not distinguished, the results reveal that soil pH is a factor in structuring viral communities at local and global scales.