Microbes commonly live in dense surface-attached communities where cells layer on top of one another such that only those at the edges have unimpeded access to limiting nutrients and space. Theory predicts that this simple spatial effect, akin to plants competing for light in a forest, generates strong natural selection on microbial phenotypes. However, we require direct empirical tests of the importance of this spatial structuring. Here we show that spontaneous mutants repeatedly arise, push their way to the surface, and dominate colonies of the bacterium Pseudomonas fluorescens Pf0-1. Microscopy and modeling suggests that these mutants use secretions to expand and push themselves up to the growth surface to gain the best access to oxygen. Physically mixing the cells in the colony, or introducing space limitations, largely removes the mutant's advantage, showing a key link between fitness and the ability of the cells to position themselves in the colony. We next follow over 500 independent adaptation events and show that all occur through mutation of a single repressor of secretions, RsmE, but that the mutants differ in competitiveness. This process allows us to map the genetic basis of their adaptation at high molecular resolution and we show how evolutionary competitiveness is explained by the specific effects of each mutation. By combining population level and molecular analyses, we demonstrate how living in dense microbial communities can generate strong natural selection to reach the growing edge.bacteria | biofilm | experimental evolution | social interaction