Evolutionary adaptation of multicellular organisms to a closed gut created an internal microbiome differing from that of the environment. While the composition of the gut microbiome is impacted by diet and disease state, we hypothesized that vertebrates promote colonization by commensal bacteria through shaping of the apical surface of the intestinal epithelium. Here, we determine that the evolutionarily ancient FOXA transcription factors control the composition of the gut microbiome by establishing favorable glycosylation on the colonic epithelial surface. FOXA proteins bind to regulatory elements of a network of glycosylation enzymes which become deregulated when Foxa1 and Foxa2 are deleted from the intestinal epithelium. As a direct consequence, microbial composition shifts dramatically, and spontaneous inflammatory bowel disease ensues. Remarkably, this microbiome dysbiosis was quickly reversed upon transplant into wild-type mice, establishing a dominant role for the host epithelium, in part mediated by the FOXA factors, in controlling the symbiosis in the vertebrate holobiont.