Phytopathogenic fungal growth in postharvest fruits and vegetables is responsible for 20–25% of production losses. Volatile organic compounds (VOCs) have been gaining importance in the food industry as a safe and ecofriendly alternative to pesticides for combating these phytopathogenic fungi. In this study, we analysed the ability of some VOCs produced by strains of the genera Bacillus, Peribacillus, Pseudomonas, Psychrobacillus and Staphylococcus to inhibit the growth of Alternaria alternata, Botrytis cinerea, Fusarium oxysporum, Fusarium solani, Monilinia fructicola, Monilinia laxa and Sclerotinia sclerotiorum, in vitro and in vivo. We analysed bacterial VOCs by using GC/MS and 87 volatile compounds were identified, in particular acetoin, acetic acid, 2,3-butanediol, isopentanol, dimethyl disulphide and isopentyl isobutanoate. In vitro growth inhibition assays and in vivo experiments using cherry fruits showed that the best producers of VOCs, Bacillus atrophaeus L193, Bacillus velezensis XT1 and Psychrobacillus vulpis Z8, exhibited the highest antifungal activity against B. cinerea, M. fructicola and M. laxa, which highlights the potential of these strains to control postharvest diseases. Transmission electron microscopy micrographs of bacterial VOC-treated fungi clearly showed antifungal activity which led to an intense degeneration of cellular components of mycelium and cell death.