In the prospect of understanding the photoluminescence mechanisms of AlN films doped with erbium and targeting photonic applications we have synthesized non doped and Er-doped AlN films with different crystallized nanostructures by using PVD magnetron sputtering. Their crystalline morphology and their visible photoluminescence properties were precisely measured.Due to the weak cross-section absorption of rare earths like erbium, it is necessary to obtain an efficient energy transfer mechanism between the host matrix and the rare earth to obtain high luminescence efficiency. Our strategy is then to elaborate some nanostructures that could introduce additional intermediate electronic levels within the gap thanks to the presence of structural defects (point defects, grain boundaries{ldots}) and could lead to energy transfer from the AlN matrix to the rare earth.Doped and non-doped AlN films were prepared by radio frequency magnetron sputtering by using different experimental conditions that will be detailed. It will notably be shown how a negative polarization of samples during deposition allows obtaining crystalline morphologies ranging from the classical columnar structure to a highly disordered polycrystalline structure with grains of several nanometers (nearly amorphous). The nanostructures of the films could be categorized in three types: 1) type 1 was nanocolumnar (width of column ~ 15 nm), 2) type 2 was made of short columns (width of column ~ 10 nm) and 3) the last type was made of equiaxed nanocrystallites (size of grains ~3-4 nm).High-resolution photoluminescence spectroscopy was performed to characterize their optical behaviour. The samples were excited by the laser wavelengths at 458, 488 or 514 nm. A broad photoluminescence band was observed centred around 520 nm in columnar samples. In the same energy range, the highly resolved spectra also showed several sharp emission peaks. This fine structure could be attributed to erbium transitions. This fine structure tended to disappear going from type 1 to type 3 samples. Indeed, the relative intensity of the peaks decreased and their full width at half maximum increased. This change could be related to the density of defects that increased when the size of the grains decreased. The photoluminescence properties of the films in the visible range will be discussed in relation with their structure.