Fever is a common adverse reaction to vaccination, contributing to vaccine hesitancy and reduced uptake. To understand variation in fever risk, we longitudinally profiled fecal microbiota, oral temperature, and serological markers in 171 healthy adults receiving Severe acute respiratory syndrome coronavirus 2 mRNA vaccines. Fever risk correlated with low-grade intestinal inflammation, increased abundance of flagellated Lachnospiraceae bacteria, and increased flagellin expression prevaccine. Microbiomes from fever-high donors triggered stronger inflammation in human intestinal organoids and drove flagellin-dependent vaccine reactions in gnotobiotic mice. Moreover, microbiome flagellin phenotypes and murine vaccine reactions were modifiable by diet. Consistent with this, human fever risk was associated with self-reported diet and metabolic markers.