When bacteria encounter surfaces, they respond with surface colonization and virulence induction. The mechanisms of bacterial mechanosensation and downstream signaling remain poorly understood. Here, we describe a tactile sensing cascade in Caulobacter crescentus in which the flagellar motor acts as sensor. Surface-induced motor interference stimulated the production of the second messenger cyclic diguanylate by the motor-associated diguanylate cyclase DgcB. This led to the allosteric activation of the glycosyltransferase HfsJ to promote rapid synthesis of a polysaccharide adhesin and surface anchoring. Although the membrane-embedded motor unit was essential for surface sensing, mutants that lack external flagellar structures were hypersensitive to mechanical stimuli. Thus, the bacterial flagellar motor acts as a tetherless sensor reminiscent of mechanosensitive channels.