Abstract We have investigated homoepitaxy of AlN films grown by molecular beam epitaxy on AlN/sapphire templates by adopting both the continuous growth method and the Al modulation epitaxy (AME) growth method. The continuous growth method encounters significant challenges in controlling the growth mode. As the precise Al/N = 1.0 ratio is difficult to achieve, either the excessive Al-rich or N-rich growth mode occurs. In contrast, by adopting the AME growth method, such a difficulty has been effectively overcome. By manipulating the supply time of the Al and nitrogen sources, we were able to produce AlN films with much improved surface morphology. The first step of the AME method, only supplying Al atoms, is important to wet the surface and the Al adatoms can act as a surfactant. Optimization of the initial Al supply time can effectively reduce the pit density on the grown AlN surface. The pits density dropped from 12 pits/μm2 to 1 pit/μm2 and the surface roughness reduced from 0.72 nm to 0.3 nm in a 2 × 2 μm2 area for the AME AlN film homoepitaxially grown on an AlN template.