Aggregation of the German cockroach, Blattella germanica, is regulated by fecal aggregation agents (pheromones), including volatile carboxylic acids (VCAs). We demonstrate that the gut microbial community contributes to production of these semiochemicals. Chemical analysis of the fecal extract of B. germanica revealed 40 VCAs. Feces from axenic cockroaches (no microorganisms in the alimentary tract) lacked 12 major fecal VCAs, and 24 of the remaining compounds were represented at extremely low amounts. Olfactory and aggregation bioassays demonstrated that nymphs strongly preferred the extract of control feces over the fecal extract of axenic cockroaches. Additionally, nymphs preferred a synthetic blend of 6 fecal VCAs over a solvent control or a previously identified VCA blend. To test whether gut bacteria contribute to the production of fecal aggregation agents, fecal aerobic bacteria were cultured, isolated, and identified. Inoculation of axenic cockroaches with individual bacterial taxa significantly rescued the aggregation response to the fecal extract, and inoculation with a mix of six bacterial isolates was more effective than with single isolates. The results indicate that the commensal gut microbiota contributes to production of VCAs that act as fecal aggregation agents and that cockroaches discriminate among the complex odors that emanate from a diverse microbial community. Our results highlight the pivotal role of gut bacteria in mediating insect-insect communication. Moreover, because the gut microbial community reflects the local environment, local plasticity in fecal aggregation pheromones enables colony-specific odors and fidelity to persistent aggregation sites.gut bacteria | aggregation | pheromone | cockroach | communication