The successful colonisation of new habitats has played a fundamental role during the evolution of life. Salinity is one of the strongest barriers for organisms to cross, which has resulted in the evolution of distinct marine and terrestrial (including both freshwater and soil) communities. Although microbes represent by far the vast majority of eukaryote diversity, the role of the salt barrier in shaping the diversity across the eukaryotic tree is poorly known. Traditional views suggest rare and ancient marine-terrestrial transitions, but this view is being challenged by the discovery of several recently transitioned lineages. Here, we investigate habitat evolution across the tree of eukaryotes using a unique set of taxon-rich environmental phylogenies inferred from a combination of long-read and short-read metabarcoding data spanning the ribosomal DNA operon. Our results show that overall marine and terrestrial microbial communities are phylogenetically distinct, but transitions have occurred in both directions in almost all major eukaryotic lineages, with at least 350 transition events detected. Some groups have experienced relatively high rates of transitions, most notably fungi for which crossing the salt barrier has most likely been an important aspect of their successful diversification. At the deepest phylogenetic levels, ancestral habitat reconstruction analyses suggest that eukaryotes may have first evolved in non-saline habitats, and that the two largest known eukaryotic assemblages (TSAR and Amorphea) arose in different habitats. Overall, our findings indicate that crossing the salt barrier has played an important role in eukaryotic evolution by providing new ecological niches to fill.