Redshift surveys like the Sloan Digital Sky Survey (SDSS) have given a very precise measurement of the galaxy luminosity function down to about M_R = -17 (~ M_B = -16). Fainter absolute magnitudes cannot be probed because of the flux limit required for spectroscopy. Wide-field surveys of nearby groups using mosaic CCDs on large telescopes are able to reach much fainter absolute magnitudes, about M_R = -10. These diffuse, spiral-rich groups are thought to be typical environments for galaxies so their luminosity functions should be the same as the field luminosity function. The luminosity function of the groups at the bright end (M_R < -17) is limited by Poisson statistics and is far less precise than that derived from redshift surveys. Here we combine the results of the SDSS and the surveys of nearby groups and supplement the results with studies of Local Group galaxies in order to determine the galaxy luminosity function over the entire range -25 <M_R < -9. The average logarithmic slope of the field luminosity function between M_R = -19 and M_R = -9 is alpha = -1.26, although a single power law is a poor fit to the data over the entire magnitude range. We also determine the luminosity function of galaxy clusters and demonstrate that it is different from the field luminosity function at a high level of significance: there are many more dwarf galaxies in clusters than in the field, due to a rise in the cluster luminosity function of alpha ~ -1.6 between M_R = -17 and M_R = -14.