We investigated the variation in the fraction of optical active galactic nuclei (AGN) hosts with stellar mass, as well as their local and global environments. Our sample is composed of cluster members and field galaxies at $z le 0.1$ and we consider only strong AGN. We find a strong variation in the AGN fraction ($F_{AGN}$) with stellar mass. The field population comprises a higher AGN fraction compared to the global cluster population, especially for objects with log $M_* > 10.6$. Hence, we restricted our analysis to more massive objects. We detected a smooth variation in the $F_{AGN}$ with local stellar mass density for cluster objects, reaching a plateau in the field environment. As a function of clustercentric distance we verify that $F_{AGN}$ is roughly constant for R $> $ R$_{200}$, but show a steep decline inwards. We have also verified the dependence of the AGN population on cluster velocity dispersion, finding a constant behavior for low mass systems ($sigma_P lesssim 650-700$ km s$^{-1}$). However, there is a strong decline in $F_{AGN}$ for higher mass clusters ($>$ 700 km s$^{-1}$). When comparing the $F_{AGN}$ in clusters with or without substructure we only find different results for objects at large radii (R $> $ R$_{200}$), in the sense that clusters with substructure present some excess in the AGN fraction. Finally, we have found that the phase-space distribution of AGN cluster members is significantly different than other populations. Due to the environmental dependence of $F_{AGN}$ and their phase-space distribution we interpret AGN to be the result of galaxy interactions, favored in environments where the relative velocities are low, typical of the field, low mass groups or cluster outskirts.