Many notorious insect pests live in the symbiotic associations with gut microbiota. However, the mechanisms underlying how they host their gut microbiota are unknown. Most gut bacteria can release peptidoglycan (PGN) which is an important antigen to activate the immune response. Therefore, how to keep the appropriate gut immune intensity to host commensals while to efficiently remove enteropathogens is vital for insect health. This study is aimed at elucidating the roles of an amidase PGRP, Rf PGRP-LB, in maintaining the gut-microbe symbiosis of Red palm weevil (RPW), Rhynchophorus ferrugineus Olivier. RfPGRP-LB is a secreted protein containing a typical PGRP domain. The existence of five conservative amino acid residues, being required for amidase activity, showed that RfPGRP-LB is a catalytic protein. Expression analysis revealed abundance of RfPGRP-LB transcripts in gut was dramatically higher than those in other tissues. RfPGRP-LB could be significantly induced against the infection of Escherichia coli. In vitro assays revealed that rRfPGRP-LB impaired the growth of E. coli and agglutinated bacteria cells obviously, suggesting RfPGRP-LB is a pathogen recognition receptor and bactericidal molecule. RfPGRP-LB knockdown reduced the persistence of E. coli in gut and load of indigenous gut microbiota significantly. Furthermore, the community structure of indigenous gut microbiota was also intensively altered by RfPGRP-LB silence. Higher levels of the antimicrobial peptide, attacin, were detected in guts of RfPGRP-LB silenced larvae than controls. Collectively, RfPGRP-LB plays multiple roles in modulating the homeostasis of RPW gut microbiota not only by acting as a negative regulator of mucosal immunity through PGN degradation but also as a bactericidal effector to prevent overgrowth of commensals and persistence of noncommensals.