Histone deacetylases (HDACs) remove acetyl groups from lysine residues of histone and non-histone proteins. Class IIa HDACs (HDAC4, 5, 7, 9) drive macrophage inflammatory responses, but their contributions to host defence have not been explored. Here, we show that pharmacological or genetic targeting of Hdac7 led to greatly increased bacterial loads and dissemination of a representative strain (EC958) of the globally-disseminated uropathogenic Escherichia coli clone ST131, in an intraperitoneal challenge model in mice. Challenge of primary mouse macrophages with E. coli also resulted in a rapid increase in class IIa HDAC enzyme activity. Pharmacological or genetic targeting of Hdac7 impaired phagocytosis of E. coli and bacterial clearance by primary murine macrophages. Conversely, primary macrophages from Mac-Hdac7 mice that selectively over-express Hdac7 in myeloid cells displayed increased phagocytosis and intracellular killing in comparison to control cells. The antimicrobial effects of Hdac7 were dependent on its enzymatic activity, since an enzyme dead mutant was unable to reconstitute antimicrobial functions of Hdac7. Interestingly, the antimicrobial effects of Hdac7 were independent of its proinflammatory functions, which are mediated by the glycolytic enzyme pyruvate kinase isoform M2. Instead, we provide evidence that Hdac7 drives antimicrobial responses via the pentose phosphate pathway enzyme, 6-phosphogluconate dehydrogenase (6-PGD). Hdac7 promotes phagocyte oxidase-dependent reactive oxygen species production, with inhibition of either glucose uptake or phagocyte oxidase blocking the antimicrobial phenotype of Mac-Hdac7 macrophages. Mechanistically, genetic targeting or pharmacological inhibition of Hdac7 significantly reduces the activity of 6-PGD, an enzyme generating NADPH for phagocyte oxidase function. Finally, in contrast to its role in promoting lipopolysaccharide (LPS)-driven IL-1b production, Hdac7 limits E. coli-induced IL-1b, suggesting that Hdac7 discriminates between different types of danger. We propose that HDAC7 responds to local threats by coordinating effective innate defence and limiting leukocyte recruitment, whereas it drives a systemic inflammatory response upon sensing distal danger.