Cobalt-doped ZnO films were grown on the glass substrates using sol–gel/spin-coating technique to investigate the effect of annealing on the structural and magnetic properties. The X-ray diffraction (XRD) patterns of the Co-doped ZnO films are dominated by the (002) peak, suggesting an up-standing array of ZnO structure hexagonal (wurtzite) with a good crystalline quality, however, the secondary phases of Co3O4 and Co are present in the samples. With the annealing temperature increased, the secondary phases tend to disappear completely and the intensity of the (002) peak increased, indicating a high crystallinity of the samples. For the ZnO majority phase, the lattice constant (c)c) decreases (from 5.232 Å to 5.224 Å), while the crystallite size increases (from 22.040nm to 24.018nm) as the annealing temperature varies from 380∘C to 600∘C. Significant changes in the dislocation density (δ), strain (εc) and stress (σc) of the Co-doped ZnO films were also observed, by increasing the annealing temperature. All samples display a ferromagnetic behavior with variations in the saturation magnetization (Ms=1.31×10−5, 1.19×10−5 and 1.15×10−5 emu/cm3) and coercive field (Hc=82, 104 and 75 Oe) for the temperatures of 380∘C, 500∘C and 600∘C, respectively. The magnetic behavior of Co-doped ZnO films confirms the exchange interaction between the local spin moments produced by the oxygen vacancy. In addition, the ferromagnetic existence of the samples (380∘C, 500∘C and 600∘C) can be attributed to certain nanoparticles or to the binding of Co+2 ions at the Zn+2 location in the ZnO lattice. Finally, it appears that the ferromagnetism at room temperature found in these films, is consistent with endogenous defects (oxygen vacancies) and magnetic ions insertion along the same lines.