We simulate the growth of galaxies and their central supermassive black holes by implementing a suite of semi-analytic models on the output of the Millennium Run, a very large simulation of the concordance Λ cold dark matter cosmogony. Our procedures follow the detailed assembly history of each object and are able to track the evolution of all galaxies more massive than the Small Magellanic Cloud throughout a volume comparable to that of large modern redshift surveys. In this first paper we supplement previous treatments of the growth and activity of central black holes with a new model for ‘radio’ feedback from those active galactic nuclei that lie at the centre of a quasi-static X-ray-emitting atmosphere in a galaxy group or cluster. We show that for energetically and observationally plausible parameters such a model can simultaneously explain: (i) the low observed mass drop-out rate in cooling flows; (ii) the exponential cut-off at the bright end of the galaxy luminosity function; and (iii) the fact that the most massive galaxies tend to be bulge-dominated systems in clusters and to contain systematically older stars than lower mass galaxies. This success occurs because static hot atmospheres form only in the most massive structures, and radio feedback (in contrast, for example, to supernova or starburst feedback) can suppress further cooling and star formation without itself requiring star formation. We discuss possible physical models that might explain the accretion rate scalings required for our phenomenological ‘radio mode’ model to be successful.