Evidence is accumulating that demonstrates the importance of the gut microbiota in health and diseases such as allergy. Recent studies emphasize the importance of the "window of opportunity" in early life, during which interventions altering the gut microbiota induce long-term effects. The neonate's gut microbiota composition and metabolism could therefore play an essential role in allergic disease risk. Breastfeeding shapes the gut microbiota in early life, both directly by exposure of the neonate to the milk microbiota and indirectly, via maternal milk factors that affect bacterial growth and metabolism such as human milk oligosaccharides, secretory IgA, and anti-microbial factors. The potential of breastmilk to modulate the offspring's early gut microbiota is a promising tool for allergy prevention. Here, we will review the existing evidence demonstrating the impact of breastfeeding on shaping the neonate's gut microbiota and highlight the potential of this strategy for allergy prevention.