A human gut-on-a-chip microdevice was used to coculture multiple commensal microbes in contact with living human intestinal epithelial cells for more than a week in vitro and to analyze how gut microbiome, inflammatory cells, and peristalsis-associated mechanical deformations independently contribute to intestinal bacterial overgrowth and inflammation. This in vitro model replicated results from past animal and human studies, including demonstration that probiotic and antibiotic therapies can suppress villus injury induced by pathogenic bacteria. By ceasing peristalsis-like motions while maintaining luminal flow, lack of epithelial deformation was shown to trigger bacterial overgrowth similar to that observed in patients with ileus and inflammatory bowel disease. Analysis of intestinal inflammation on-chip revealed that immune cells and lipopolysaccharide endotoxin together stimulate epithelial cells to produce four proinflammatory cytokines (IL-8, IL-6, IL-1β, and TNF-α) that are necessary and sufficient to induce villus injury and compromise intestinal barrier function. Thus, this human gut-on-a-chip can be used to analyze contributions of microbiome to intestinal pathophysiology and dissect disease mechanisms in a controlled manner that is not possible using existing in vitro systems or animal models.