The structures, electronic and magnetic properties of (ZnSe)12 clusters doped with one and two Co atoms have been studied in term of a first-principles method. Substitutional, exohedral, and endohedral dopings are considered. The exohedral isomer is found to be most favorable in energy for monodoped clusters, while the endohedral isomer is found to be most favorable for bidoped clusters. The magnetic moments are contributed mainly by the 3d component of Co atom, while the 4s and 4p orbitals also have certain contributions. Due to the hybridization interaction, a small magnetic moment is induced in the nearest neighboring Se and Zn atoms. Most importantly, we demonstrate that the endohedral bidoped (ZnSe)12 clusters favor the ferromagnetic state, which has potential applications in nanoscale quantum devices.