Maternal microbiota forms the first infant gut microbial inoculum, and perinatal factors (diet and use of antibiotics during pregnancy) and/or neonatal factors, like intra partum antibiotics, gestational age and mode of delivery, may influence microbial colonization. After birth, when the principal colonization occurs, the microbial diversity increases and converges toward a stable adult-like microbiota by the end of the first 3–5 years of life. However, during the early life, gut microbiota can be disrupted by other postnatal factors like mode of infant feeding, antibiotic usage, and various environmental factors generating a state of dysbiosis. Gut dysbiosis have been reported to increase the risk of necrotizing enterocolitis and some chronic diseases later in life, such as obesity, diabetes, cancer, allergies, and asthma. Therefore, understanding the impact of a correct maternal-to-infant microbial transfer and a good infant early colonization and maturation throughout life would reduce the risk of disease in early and late life. This paper reviews the published evidence on early-life gut microbiota development, as well as the different factors influencing its evolution before, at, and after birth, focusing on diet and nutrition during pregnancy and in the first months of life.