E. coli O157: H7 is a common pathogenic bacterium in food and water that can pose a threat to human health. The aim of this study was to develop LAMP method for the detection of E. coli O157: H7 in food based on the specific gene Ecs_2840, and to construct rapid detection kits based on the established methods. Specifically, we established two methods of Real-time fluorescent LAMP (RT-LAMP) and visual LAMP with calcein as indicator. In pure bacterial culture, the cell sensitivity and genomic sensitivity of the RT-LAMP kit were 8.8 × 10°CFU·mL-1 and 4.61 fg·µL-1 respectively. The sensitivity of the visual LAMP kit were 2.35 × 10°CFU·mL-1 and 4.61 fg·µL-1. Both kits had excellent specificity and anti-interference performance. In addition, milk inoculated with 2.26 × 10°CFU·mL-1 E. coli O157: H7 could be detected within the reaction time after enrichment for 3 hours. The results showed that the LAMP kits were rapid, sensitive and specific for the detection of E. coli O157: H7 in food and had good application prospects in food safety surveillance.