The diversity of plant-associated microbial communities is shaped by both host factors and the environment. Natural environmental gradients, specifically elevational ones, can serve as study systems to understand community and ecosystem responses to environmental changes, however the relationship between elevation and microbial diversity is not completely understood, especially in non-model systems such as wild plants. In this paper we explored the role of environmental factors in shaping the diversity and structure of the rhizosphere and phyllosphere of the cloud forest tree fern Cyathea fulva. Samples of phyllosphere, rhizosphere and soil were collected from 15 individual tree ferns across five forest plots along an elevation gradient ranging from 1978 to 2210 meters above sea level. Physicochemical soil data were collected, along with environmental data of all plots. Using 16S rRNA and ITS1 amplicon sequencing, we tested for differences in diversity and composition of bacterial and fungal communities and their potential abiotic drivers. We found that bacterial alpha diversity decreased with elevation in the phyllosphere and rhizosphere, but for fungi this pattern was only found in the rhizosphere. We also observed significant changes in community structure and composition with elevation in both the fungal and bacterial phyllosphere and rhizosphere. Our results suggest a close relationship between elevation and the overall microbial structure associated with tree ferns. We envision this information will help to further understand the dynamics between microbiota and wild plants, contributing to the conservation of necessary interactions for plants and ecosystems wellbeing.