The human gut in colonized by trillions of viruses, bacteria and fungi, collectively termed the microbiome. While these microbes serve important functions, they also pose a challenge for the immune system who recognizes them as a threat and might mount an inflammatory response. Separating the microbiome from the host is a thin layer of mucus, which both protects the host from bacterial invasion and also provides energy for the microbiome. If this mucus layer becomes impaired and bacteria allowed to penetrate it, inflammatory bowel diseases develop. Here, we will discuss molecular and physiological aspects of the mucus layer and its role in inflammatory bowel diseases such as Crohn’s disease and ulcerative colitis.