When a supermassive black hole at the centre of a galaxy accretes matter, it gives rise to a highly energetic phenomenon: an active galactic nucleus. Numerous physical processes have been proposed to account for the funnelling of gas towards the galactic centre to feed the black hole. There are also several physical processes that can remove gas from a galaxy, one of which is ram-pressure stripping by the hot gas that fills the space between galaxies in galaxy clusters. Here we report that six out of a sample of seven ‘jellyfish’ galaxies—galaxies with long ‘tentacles’ of material that extend for dozens of kiloparsecs beyond the galactic disks—host an active nucleus, and two of them also have galactic-scale ionization cones. The high incidence of nuclear activity among heavily stripped jellyfish galaxies may be due to ram pressure causing gas to flow towards the centre and triggering the activity, or to an enhancement of the stripping caused by energy injection from the active nucleus, or both. Our analysis of the galactic position and velocity relative to the cluster strongly supports the first hypothesis, and puts forward ram pressure as another possible mechanism for feeding the central supermassive black hole with gas.