Epiphytic ferns have been found to flourish after angiosperms dominated forest communities, and they play important roles in rainforest canopies. How do epiphytic ferns adapt to tropical rainforest canopy habitats? At present, we know little about the molecular mechanism underlying this adaptation. Asplenium nidus is a well-known epiphytic fern that is closely related to the terrestrial species Asplenium komarovii. Here, RNA-seq and comparative transcriptomic analyses were performed to explore the underlying basis of the adaptation of A. nidus to extreme environments. A total of 44.04 and 44.57 Mb clean reads were obtained from A. nidus and A. komarovii, respectively, and they were assembled into 89,741 and 77,912 unigenes. Functional annotation showed that 52,305 (58.28% of the total genes for A. nidus) and 45,938 (58.96% of the total genes for A. komarovii) unigenes were annotated in public databases. Genes involved in stress responses and photosynthesis were found to have undergone positive selection in A. nidus. Compared to A. komarovii, transcription factors related to stress response, leaf development, and root development were found to be considerably expanded in A. nidus, especially in the ANR1 subclade of MADS-box family genes which played roles in lateral root development. This study improves our understanding of the adaptation of A. nidus to epiphytic habitats by forming unique strategies.