Knowing the environment that is unfavorable for the growth of pathogens can be used as basic information to develop appropriate strategies to prevent the occurrence of disease in dragon fruit. In this paper, a number of environmental factors including temperature, pH and salinity, as well as biological factors including endogenous bacteria species isolated from pitaya showing antagonistic activity on fungi, Alternaria alternata was studied. The growth of A. alternata mycelium is inhibited at 35°C, while 25°C is quite suitable for their growth. The temperature of 30°C is favorable for the development of A. alternata. Under different pH conditions, the growth of A. alternata is most inhibited at pH 4. Moreover, the salinity test results show that A. alternata is not significantly affected by salt concentrations tested. Meanwhile, in vitro testing of antagonistic bacteria showed that both EC120 and EC121 were highly effective in inhibiting the growth of the fungus under investigation. The results of the experiment show that the proper combination of environmental regulation and care regimen can be very beneficial for crop growth in the field as well as the longevity of fruit after harvest.