Aims. We study the environmental effects on the activity in galactic nuclei by comparing galaxies in clusters and in the field. Methods. Using a spectroscopic sample of galaxies in Abell clusters from the Sloan Digital Sky Survey Data Release 7, we investigate the dependence of nuclear activity on the physical parameters of clusters as well as the nearest neighbor galaxy. We also compare galaxy properties between active galactic nuclei (AGNs) hosts and non-AGN galaxies. Results. We find that the AGN fraction of early-type galaxies starts to decrease around one virial radius of clusters (r 200,cl ) as decreasing clustercentric radius, while that of late types starts to decrease close to the cluster center (R ∼ 0.1−0.5r 200,cl ). The AGN fractions of early-type cluster galaxies, on average, are found to be lower than those of early-type field galaxies by a factor ∼3. However, the mean AGN fractions of late-type cluster galaxies are similar to those of late-type field galaxies. The AGN fraction of early-type brightest cluster galaxies lies between those of other early-type, cluster and field galaxies with similar luminosities. In the field, the AGN fraction is strongly dependent on the morphology of and the distance to the nearest neighbor galaxy. We find an anti-correlation between the AGN fraction and the velocity dispersion of clusters for all subsamples divided by morphology and luminosity of host galaxies. The AGN power indicated by L [OIII] /M BH is found to depend strongly on the mass of host galaxies rather than the clustercentric radius. The difference in physical parameters such as luminosity, (u − r) colors, star formation rates, and (g − i) color gradients between AGN hosts and non-AGN galaxies is seen for both early and late types at all clustercentric radii, while the difference in structure parameters between the two is significant only for late types. Conclusions. These results support the idea that the activity in galactic nuclei is triggered through galaxy-galaxy interactions and mergers when gas supply for AGN is available.