The Co@ZnO thin film deposited on glass substrate with dopant contents of cobalt ranging from 0 to 10 % were fabricated using spray pyrolysis coating method. The prepared nanocomposite thin film was characterized by scanning electron microscopy, X-ray diffraction, UV–vis and Raman spectroscopy. Some surfaces structural probing of the deposited samples confirmed nanolamination of hexagonal wurtzite phase of ZnO with no other impurity phases and high adherence on the soda lime glass substrate. Average grain sizes (56–43 nm) and lattice strain of the films were found to be tailored with the variation of Co-dopant content, signifying phonon confinement or defect/disorder caused by the Co-dopant impurity on the ZnO host particle owing to the impurity levels and oxygen vacancy states. The film demonstrated high optical transmittance with enhanced photoabsorbtion and narrow optical band gap (3.24–2.64 eV) with increasing Co-dopant content. In evaluating its antibacterial efficacy, the Co@ZnO thin film was tested at different dopant concentration against Bacillus cereus (foodborne pathogen). The result revealed that the films exhibits excellent inhibitory effect on the pathogen, with highest activity obtained at 10 % Co@ZnO. Furthermore, a more improved inhibitory activity was recorded when at 10 % Co@ZnO dopant was exposed to UV irradiation.