Bacteria in the gastrointestinal tract play a crucial role in intestinal motility, homeostasis, and dysfunction. Unraveling the mechanisms by which microbes impact the host poses many challenges due to the extensive array of metabolites produced or metabolized by bacteria in the gut. Here, we describe the engineering of a gut commensal bacterium, Escherichia coli Nissle 1917, to biosynthesize the human metabolite serotonin for examining the effects of microbially produced biogenic amines on host physiology. Upon oral administration to mice, our engineered bacteria reach the large intestine, where they produce serotonin. Mice treated with serotonin-producing bacteria exhibited biological changes in the gut at transcriptional and physiological levels. This work establishes a novel framework employing engineered bacteria to modulate luminal serotonin levels and suggests potential clinical applications of modified microbial therapeutics to address gut disorders in humans.