The effect of AlN buffer layer on the quality of GaN epilayer grown on Si substrate by metalorganic chemical vapor deposition (MOCVD) has been investigated. It was found that the quality of GaN epilayer strongly related with the crystal quality of AlN buffer layer. As the full width at half maximum (FWHM) of AlN (0 0 2) plane increased from 1.23 degree to 3.41 degree, the FWHM of GaN (0 0 2) plane varied from 432 arcsec to 936 arcsec and the FWHM of GaN (1 0 2) plane varied from 677 arcsec to 1226 arcsec. Besides, more cracks formed and threading dislocation (TD) density increased. The deteriorated AlN buffer layer also led to a rougher morphology of the GaN layer, as can be seen from the root mean square (RMS) roughness of GaN layer which varied from 0.178 nm to 0.476 nm. And the morphology of AlN and the quality of GaN epilayer are not appear to be relevant due to the ruleless values of RMS roughness of AlN.