Bacterial colonization of the gut shapes both the local and the systemic immune response and is implicated in the modulation of immunity in both healthy and disease states. Recently, quantitative and qualitative changes in the composition of the gut microbiota have been detected in Crohn's disease and ulcerative colitis, reinforcing the hypothesis of dysbiosis as a relevant mechanism underlying inflammatory bowel disease (IBD) pathogenesis. Humans and microbes have coexisted and co-evolved for a long time in a mutually beneficial symbiotic association essential for maintaining homeostasis. However, the microbiome is dynamic, changing with age and in response to environmental modifications. Among such environmental factors, food and alimentary habits, progressively altered in modern societies, appear to be critical modulators of the microbiota, contributing to or co-participating in dysbiosis. In addition, food constituents such as micronutrients are important regulators of mucosal immunity, with direct or indirect effects on the gut microbiota. Moreover, food constituents have recently been shown to modulate epigenetic mechanisms, which can result in increased risk for the development and progression of IBD. Therefore, it is likely that a better understanding of the role of different food components in intestinal homeostasis and the resident microbiota will be essential for unravelling the complex molecular basis of the epigenetic, genetic and environment interactions underlying IBD pathogenesis as well as for offering dietary interventions with minimal side effects.