GaN is an excellent host for erbium (Er) to provide optical emission in the technologically important as well as eye-safe 1540 nm wavelength window. Er doped GaN (GaN:Er) epilayers were synthesized on c-plane sapphire substrates using metal organic chemical vapor deposition. By employing a pulsed growth scheme, the crystalline quality of GaN:Er epilayers was significantly improved over those obtained by conventional growth method of continuous flow of reaction precursors. X-ray diffraction rocking curve linewidths of less than 300 arc sec were achieved for the GaN (0002) diffraction peak, which is comparable to the typical results of undoped high quality GaN epilayers and represents a major improvement over previously reported results for GaN:Er. Spectroscopic ellipsometry was used to determine the refractive index of the GaN:Er epilayers in the 1540 nm wavelength window and a linear dependence on Er concentration was found. The observed refractive index increase with Er incorporation and the improved crystalline quality of the GaN:Er epilayers indicate that low loss GaN:Er optical waveguiding structures are feasible.