Diversity of microbial organisms is linked to global climatic gradients. The genus Phytophthora includes both aquatic and terrestrial plant pathogenic species that display a large variation of functional traits. The extent to which the physical environment (water or soil) modulates the interaction of microorganisms with climate is unknown. Here, we explored the main environmental drivers of diversity and functional trait composition of Phytophthora communities. Communities were obtained by a novel metabarcoding setup based on PacBio sequencing of river filtrates in 96 river sites along a geographical gradient. Species were classified as terrestrial or aquatic based on their phylogenetic clade. Overall, terrestrial and aquatic species showed contrasting patterns of diversity. For terrestrial species, precipitation was a stronger driver than temperature, and diversity and functional diversity decreased with decreasing temperature and precipitation. In cold and dry areas, the dominant species formed resistant structures and had a low optimum temperature. By contrast, for aquatic species, temperature and water chemistry were the strongest drivers, and diversity increased with decreasing temperature and precipitation. Within the same area, environmental filtering affected terrestrial species more strongly than aquatic species (20% versus 3% of the studied communities, respectively). Our results highlight the importance of functional traits and the physical environment in which microorganisms develop their life cycle when predicting their distribution under changing climatic conditions. Temperature and rainfall may be buffered differently by water and soil, and thus pose contrasting constrains to microbial assemblies.