Bacterial biofilms are structured multicellular communities responsible for lethal infections and catastrophic implant failure in the human body as well as industrial and marine biofouling. Knowing how free-swimming bacteria adapt their motility mechanisms near a surface is crucial for understanding the transition from the planktonic to the biofilm phenotype. Here, we identify single-bacterium surface motility mechanisms by tracking every cell in a library of microscopy movies, and show how these mechanisms influence life cycle events and biofilm morphology. We extract the motility histories of individual surface-associated P. aeruginosa cells by translating video microscopy movies into searchable databases of bacterial behavior using automated tracking algorithms, and identify fundamental appendage-specific mechanisms for P. aeruginosa surface motility. Type IV pili mediate two surface motility mechanisms: horizontally-oriented ‘crawling,’ by which the bacterium moves lengthwise with high directional persistence, and vertically-oriented ‘walking’, by which the bacterium moves with low directional persistence and high instantaneous velocity, allowing it to rapidly explore microenvironments. The flagellum mediates two additional motility mechanisms: near-surface swimming and surface- anchored ‘spinning,’ which often precedes detachment from a surface. Synergistic interactions between these different motility mechanisms influence cell attachment, division, and detachment and hence affect biofilm morphology.