Bacterial capsules have critical roles in host-pathogen interactions. They provide a protective envelope against host recognition, leading to immune evasion and bacterial survival. Here we define the capsule biosynthesis pathway ofHaemophilus influenzaeserotype b (Hib), a Gram-negative bacterium that causes severe infections in infants and children. Reconstitution of this pathway enabled the fermentation-free production of Hib vaccine antigens starting from widely available precursors and detailed characterization of the enzymatic machinery. The X-ray crystal structure of the capsule polymerase Bcs3 reveals a multi-enzyme machine adopting a basket-like shape that creates a protected environment for the synthesis of the complex Hib polymer. This architecture is commonly exploited for surface glycan synthesis by both Gram-negative and Gram-positive pathogens. Supported by biochemical studies and comprehensive 2D nuclear magnetic resonance, our data explain how the ribofuranosyltransferase CriT, the phosphatase CrpP, the ribitol-phosphate transferase CroT and a polymer-binding domain function as a unique multi-enzyme assembly.