This study reports the optimization of culture conditions and medium components of M9, an endophytic strain of Bacillus amyloliquefaciens, which we had previously isolated from kiwifruit, and evaluation of its effect on kiwifruit postharvest protection against soft rot. The method of one-factor-at-a-time was used to determine the optimum culture conditions, and response surface methodology was applied to optimize the medium constituents. After optimization, a high rate of antifungal activity (73.12% decrease in decay rate) by M9 culture filtrate against the soft rot fungal pathogen, Botryosphaeria dothidea, was obtained. Compared with the initial culture conditions, the antifungal activity of M9 culture filtrate was increased by 19.5%. Furthermore, a postharvest storage experiment on kiwifruit showed that M9 culture filtrate could maintain the quality of stored kiwifruit, delay fruit senescence, and significantly enhance the storability of kiwifruit. Using liquid chromatography-mass spectrometry, we found that the antifungal activity of M9 was associated with the presence of the C12-surfactin A lipopeptide. Practical applications Soft rot caused by Botryosphaeria dothidea is one of the most important diseases of kiwifruit, causing postharvest fruit rot. The disease progresses rapidly and is difficult to control, posing a great threat to the kiwifruit industry. In this study, the culture conditions and medium composition for culture of the strain M9 (kiwifruit endophytic Bacillus amyloliquefaciens) were optimized to maximize the inhibition of B. dothidea. A postharvest storage experiment showed that M9 culture filtrate could improve the disease resistance of kiwifruits, delay the senescence of the fruits, and maintain the quality of kiwifruit during storage. Because M9 is a natural endophyte of kiwifruit, the strategy used in this study was both effective and safe. This work will contribute to the exploitation of B. amyloliquefaciens in controlling the pathogens of kiwifruit and the development of safer and more advanced strategies for the postharvest protection of kiwifruits.