Introduction Escherichia coli (E. coli) is a significant commensal gram-negative bacterium that can give rise to various diseases. The roles of Toll-like receptor 2 (TLR2) and the NLR pyrin domain-containing 3 (NLRP3) inflammasome in sepsis induced by E. coli infection remain unclear. Methods In vivo, we investigated differences in mortality, production of inflammatory mediators, organ damage, neutrophil count, and bacterial load during E. coli infection in C57BL/6J mice, as well as in mice deficient in TLR2 or NLRP3. In vitro, we investigated the impact of E. coli on the activation of TLR2 and NLRP3 in macrophages and the influence of TLR2 and NLRP3 on the activation of inflammatory signaling pathways and the secretion of inflammatory mediators in macrophages induced by E. coli infection. Results TLR2-deficient (TLR2-/-) and NLRP3-deficient (NLRP3-/-) mice exhibit significantly increased mortality and organ damage after E. coli infection. These mice also show elevated levels of TNF-α and IL-10 in serum and peritoneal lavage fluid (PLF). Additionally, TLR2-/- and NLRP3-/- mice display heightened neutrophil recruitment, increased bacterial load in the blood. Furthermore, macrophages from these mice demonstrate a significant reduction in the activation of the MAPK signaling pathway. Conclusion TLR2 and NLRP3 play crucial roles in modulating inflammatory mediator expression, immune cell recruitment, and bactericidal activity, thereby preventing excessive tissue damage and reducing mortality in E. coli-induced sepsis.