The invention relates to the technical field of new uses of compounds, and mainly provides the use of 2-aminoimidazole derivatives in the preparation of active drugs for inhibiting bacterial biofilms. The present invention provides 2-aminoimidazole derivatives or pharmaceutically acceptable salts thereof or compositions thereof in the purposes in the preparation of the medicine of inhibiting bacterial biofilm activity, degrading bacterial biofilm, destroying bacterial biofilm, described 2-aminoimidazole The derivative has a structure shown in the following formula (I): formula (I), wherein, R is alkyl, alkenyl, alkynyl, aryl, cycloalkyl, haloalkyl, haloalkenyl, alkylamino, alkane Oxygen, arylalkoxy, aryl-O-alkyl, aryl-NH-alkyl, arylalkenyl, arylalkyl or arylalkynyl; R 1 , R 2 , R 3 and R 4 Each is independently hydrogen, alkyl, alkenyl, alkynyl, halogen, haloalkyl, alkoxy, aryl, or arylalkyl.