Gut microbiota shapes the development of the mucosal immune system and may provide protection against immune-mediated diseases. Celiac disease (CD) is a chronic inflammatory condition triggered by dietary gluten proteins, recently associated with gut microbiota alterations in cross-sectional studies comparing patients and controls. Whether or not these differences are causally related to the disease has yet to be elucidated, but evaluation of specific bacteria isolated from CD patients in experimental models suggests that they can promote an adverse response to dietary gluten, whereas other commensal bacteria can be protective. Genetic and environmental factors associated with increased CD risk have also been linked to shifts in the gut microbiota composition in infants early in life. Epigenetic mechanisms also seem to play an important role in modulating gut microbiota composition and function and, theoretically, could also influence CD risk. Here, we review the current knowledge on how host genetics, environmental factors, and epigenetic modifications could modulate gut microbiota functionality and how this may influence CD risk. Greater understanding of the role of this triad in CD onset and pathogenesis will be valuable in designing proof-of concept interventions in the gut ecosystem, with a view to improving CD management.