Obesity and diabetes increase circulating levels of microbial components derived from the gut microbiota. Individual bacterial factors (i.e., postbiotics) can have opposing effects on metabolic inflammation and blood glucose control. We tested the net effect of gut bacterial extracts on blood glucose using a microbiota-based vaccination strategy in mice. Male and female mice had improved insulin sensitivity and blood glucose control five weeks after a single subcutaneous injection of a specific dose of a bacterial extract obtained from the luminal contents of the proximal gut. Injection of mice with proximal gut extracts from germ-free mice revealed that bacteria were required for a microbiota-based vaccination to improve blood glucose control. Vaccination of Nod1 −/− , Nod2 −/− , and Ripk2 −/− mice showed that each of these innate immune proteins was required for bacterial extract injection to improve blood glucose control. A microbiota-based vaccination promoted a proximal gut immunoglobulin-G (IgG) response directed against bacterial extract antigens, where subcutaneous injection of mice with the luminal contents of the ileum elicited a bacterial extract-specific IgG response that is compartmentalized to the ileum of vaccinated mice. A microbiota-based vaccination was associated with an altered the microbiota composition in the ileum and colon of mice. Lean mice required a single injection of proximal gut bacterial extracts, but high fat diet (HFD)-fed, obese mice required prime-boost bacterial extract injections for improvements in blood glucose control. These data show that, upon subversion of the gut barrier, vaccination with proximal gut bacterial extracts engages innate immunity to promote long-lasting improvements in blood glucose control in a dose-dependent manner.