Using density functional theory combined [Formula: see text] method, the structural, electronic and optical properties of rare earth Er substituted Al atom [Formula: see text] and its complex with neighboring N vacancy [Formula: see text]-[Formula: see text] in wurtzite AlN were investigated, respectively. Calculated results show that both defects induced quite localized [Formula: see text]-[Formula: see text] related defect donor levels in the band gap but had few effects on host electronic structures. Moreover, the calculated complex dielectric functions and other optical constants show that these two defects show clear bulk optical properties, only a small peak near the redshift edge appears for the complex defect. These results show that Er dopant AlN should be a good optical material candidate for optoelectronics application.