The microbiota confers host protection by limiting the colonization of pathogenic bacteria in the gut, but the mechanisms by which pathogens overcome colonization resistance remain poorly understood. Using a high-density transposon screen in the enteric pathogen Citrobacter rodentium, we find that the bacterium requires amino acid biosynthesis pathways to colonize conventionally raised mice, but not germ-free or antibiotic-treated animals. These metabolic pathways are induced during infection by the presence of the gut microbiota. Reduced amounts of amino acids are found in the guts of conventionally raised mice compared with germ-free animals. Dietary administration of high protein increases amino acid levels in the gut and promotes pathogen colonization. Thus, the depletion of amino acids by the microbiota limits pathogen colonization, and in turn, the pathogen activates amino acid biosynthesis to expand in the presence of the microbiota.