A key feature in intestinal immunity is the dynamic intestinal barrier, which separates the host from resident and pathogenic microbiota through a mucus gel impregnated with antimicrobial peptides. Using a forward genetic screen, we have found a mutation inTvp23b, which conferred susceptibility to chemically induced and infectious colitis. Trans-Golgi apparatus membrane protein TVP23 homolog B (TVP23B) is a transmembrane protein conserved from yeast to humans. We found that TVP23B controls the homeostasis of Paneth cells and function of goblet cells, leading to a decrease in antimicrobial peptides and more penetrable mucus layer. TVP23B binds with another Golgi protein, YIPF6, which is similarly critical for intestinal homeostasis. The Golgi proteomes of YIPF6 and TVP23B-deficient colonocytes have a common deficiency of several critical glycosylation enzymes. TVP23B is necessary for the formation of the sterile mucin layer of the intestine and its absence disturbs the balance of host and microbe in vivo.