The effect of cobalt doping on the electronic, magnetic and optical properties of GaN has been investigated using density functional theory (DFT) first-principles calculations within the framework of generalized gradient approximation suggested by Perdew-Burke Ernzerhof and ultrasoft pseudopotential. The electronic band structure of cobalt (Co) doped GaN turns into half metallic rather than semiconducting in its pure form and reduces significantly too. The values of magnetic moment at Co and nitrogen (N) sites are 0.8 μB and 0.12 μB, respectively. The effect of the increase in Co concentration results in reduced spin-polarization and the Co magnetic moment itself. According to phenomenological band structure model, the p-d repulsion increases with increasing Co concentration, which subsequently lowers the spin-polarization and hence the d-d coupling increases due to possible charge transfer between Co t2d and ed states. The Co d-Dos diagram for various doping concentrations exhibits more broadened t2d levels, thus predicting the increase in stability with increase in dopant concentration. The coupling between Co atoms is ferromagnetic, mediated through neighboring Ga and N atoms. The absorption edge of Co-doped GaN manifests a red shift with the increase in doping concentration. These findings are in good agreement with the experimental results. We predict that a lower concentration of cobalt-doped GaN is appropriate for spintronic applications.