Bacteria predominantly exist as members of surfaced-attached communities known as biofilms. Many bacterial species initiate biofilms and adhere to each other using cell surface adhesins. This is the case for numerous ecologically diverse Alphaprotebacteria, which use polar exopolysaccharide adhesins for cell-cell adhesion and surface attachment. Here, we show that Rhodopseudomonas palustris, a metabolically versatile member of the alphaproteobacterial order Rhizobiales, contains a functional unipolar polysaccharide (UPP) biosynthesis gene cluster. Deletion of genes predicted to be critical for UPP biosynthesis and export abolished UPP production. We also found that R. palustris uses UPP to mediate biofilm formation across diverse photoheterotrophic growth conditions, wherein light and organic substrates are used to support growth. However, UPP was less important for biofilm formation during photoautotrophy, where light and CO 2 support growth, and during aerobic respiration with organic compounds. Expanding our analysis beyond R. palustris, we examined the phylogenetic distribution and genomic organization of UPP gene clusters among Rhizobiales species that inhabit diverse niches. Our analysis suggests that UPP is a conserved ancestral trait of the Rhizobiales but that it has been independently lost multiple times during the evolution of this clade, twice coinciding with adaptation to intracellular lifestyles within animal hosts.IMPORTANCE Bacteria are ubiquitously found as surface-attached communities and cellular aggregates in nature. Here, we address how bacterial adhesion is coordinated in response to diverse environments using two complementary approaches. First, we examined how Rhodopseudomonas palustris, one of the most metabolically versatile organisms ever described, varies its adhesion to surfaces in response to different environmental conditions. We identified critical genes for the production of a unipolar polysaccharide (UPP) and showed that UPP is important for adhesion when light and organic substrates are used for growth. Looking beyond R. palustris, we performed the most comprehensive survey to date on the conservation of UPP biosynthesis genes among a group of closely related bacteria that occupy diverse niches. Our findings suggest that UPP is important for free-living and plantassociated lifestyles but dispensable for animal pathogens. Additionally, we propose guidelines for classifying the adhesins produced by various Alphaprotebacteria, facilitating future functional and comparative studies.KEYWORDS Rhodopseudomonas, adhesin, biofilm, holdfast, phylogenetic analysis, unipolar polysaccharide