Although vertebrates harbor bacterial communities in their gastrointestinal tract whose composition is host-specific, little is known about the mechanisms by which bacterial lineages become selected. The goal of this study was to characterize the ecological processes that mediate host-specificity of the vertebrate gut symbiont Lactobacillus reuteri, and to systematically identify the bacterial factors that are involved. Experiments with monoassociated mice revealed that the ability of L. reuteri to form epithelial biofilms in the mouse forestomach is strictly dependent on the strain's host origin. To unravel the molecular basis for this host-specific biofilm formation, we applied a combination of transcriptome analysis and comparative genomics and identified eleven genes of L. reuteri 100-23 that were predicted to play a role. We then determined expression and importance of these genes during in vivo biofilm formation in monoassociated mice. This analysis revealed that six of the genes were upregulated in vivo, and that genes encoding for proteins involved in epithelial adherence, specialized protein transport, cell aggregation, environmental sensing, and cell lysis contributed to biofilm formation. Inactivation of a serine-rich surface adhesin with a devoted transport system (the SecA2-SecY2 pathway) completely abrogated biofilm formation, indicating that initial adhesion represented the most significant step in biofilm formation, likely conferring host specificity. In summary, this study established that the epithelial selection of bacterial symbionts in the vertebrate gut can be both specific and highly efficient, resulting in biofilms that are exclusively formed by the coevolved strains, and it allowed insight into the bacterial effectors of this process.