The coupling of ecology and evolution during range expansions enables mutations to establish at expanding range margins and reach high frequencies. This phenomenon, called allele surfing, is thought to have caused revolutions in the gene pool of many species, most evidently in microbial communities. It has remained unclear, however, under which conditions allele surfing promotes or hinders adaptation. Here, using microbial experiments and simulations, we show that, starting with standing adaptive variation, range expansions generate a larger increase in mean fitness than spatially uniform population expansions. The adaptation gain results from 'soft' selective sweeps emerging from surfing beneficial mutations. The rate of these surfing events is shown to sensitively depend on the strength of genetic drift, which varies among strains and environmental conditions. More generally, allele surfing promotes the rate of adaptation per biomass produced, which could help developing biofilms and other resource-limited populations to cope with environmental challenges.