The synthesis of betalain using microorganisms is an innovative developmental technology, and the excavation of microorganisms closely related to betalain can provide certain theoretical and technical support to this technology. In this study, the characteristics of soil microbial community structures and their functions in the rhizospheres of white-fleshed dragon fruit (Hylocereus undatus) and red-fleshed dragon fruit (Hylocereus polyrhizus) were analyzed. The results show that the soil bacterial and fungal compositions in the rhizospheres were shaped differently between H. undatus and H. polyrhizus. Bacterial genera such as Kribbella and TM7a were the unique dominant soil bacterial genera in the rhizospheres of H. undatus, whereas Bradyrhizobium was the unique dominant soil bacterial genus in the rhizospheres of H. polyrhizus. Additionally, Myrothecium was the unique dominant soil fungal genus in the rhizospheres of H. polyrhizus, whereas Apiotrichum and Arachniotus were the unique dominant soil fungal genera in the rhizospheres of H. undatus. Moreover, TM7a, Novibacillus, Cupriavidus, Mesorhizobium, Trechispora, Madurella, Cercophora, and Polyschema were significantly enriched in the rhizospheres of H. undatus, whereas Penicillium, Blastobotrys, Phialemonium, Marasmius, and Pseudogymnoascus were significantly enriched in the rhizospheres of H. polyrhizus. Furthermore, the relative abundances of Ascomycota and Penicillium were significantly higher in the rhizospheres of H. polyrhizus than in those of H. undatus.