Bacillus subtilis strain CL2 is antagonistic to wolfberry postharvest pathogenic fungi. In this study, we isolated and screened this strain for in vitro experiments. The result of the two-sealed-base-plates method revealed that volatile organic compounds (VOCs) emitted from the strain CL2 inhibited the hyphal growth of four pathogenic fungi Mucor circinelloides LB1, Fusarium arcuatisporum LB5, Alternaria iridiaustralis LB7, and Colletotrichum fioriniae LB8. After exposure to VOCs for 5 days, the hyphal growth of the pathogen C. fioriniae LB8 was inhibited by 73%. Scanning electron microscopy revealed that the VOCs produced by B. subtilis CL2 caused the mycelium morphology of the pathogenic fungi to deform, twist, fold, and shrink. In the in vivo experiments, we noticed that VOCs could significantly reduce the weight loss rate of wolfberry fruits caused by the pathogenic fungus M. circinelloides LB1 and that the decay incidence rate were caused by the pathogenic fungi F. arcuatisporum LB5, A. iridiaustralis LB7, and C. fioriniae LB8. On the basis of the headspace-gas chromatography-ion mobility spectrometry analysis, seven VOCs produced by strain CL2 were identified. Among them, 2,3-butanedione and 3-methylbutyric acid are the main antifungal active substances. This study investigated the antifungal properties of VOCs produced by the strain CL2 on postharvest pathogenic fungi isolated from wolfberry fruits both in vivo and in vitro, thereby providing the theoretical basis for its future applications.