The resistance of Escherichia coli O157:H7 to disinfection is associated with its ability to form biofilms, mainly constituted by glucans produced by glucosyltransferases. Citral and geraniol, terpenes found in the essential oil of Cymbopogon citratus (EO), have proven antibacterial activity against planktonic E. coli; however, no information was found about their efficacy and mode of action against E. coli biofilms. Therefore, the inhibitory effect of C. citratus EO, citral, and geraniol on glucans production and glucosyltransferase activity as anti-biofilm mechanism against E. coli was evaluated. EO, citral, and geraniol inhibited the planktonic growth of E. coli (minimal inhibitory concentration or MIC= 2.2, 1.0, and 3.0 mg/mL, respectively) and the bacterial adhesion (2.0, 2.0, and 4.0 mg/mL, respectively) on stainless steel. All compounds decreased the glucans production; citral and geraniol acted as uncompetitive inhibitors of glucosyltransferase activity (The half maximal inhibitory concentrations or IC50 were 8.5 and 6.5 µM, respectively). The evidence collected by docking analysis indicated that both terpenes could interact with the helix finger of the glucosyltransferase responsible for the polymer production. In conclusion, C. citratus EO, citral, and geraniol inhibited glucosyltransferase activity, glucans production, and the consequent biofilm formation of E. coli O157:H7.