Indoor air pollution (IAP) or environmental tobacco smoke (ETS) exposure may influence nasopharyngeal carriage of bacterial species and development of lower respiratory tract infection (LRTI). The aim of this study was to longitudinally investigate the impact of antenatal or postnatal IAP/ETS exposure on nasopharyngeal bacteria in mothers and infants. A South African cohort study followed mother-infant pairs from birth through the first year. Nasopharyngeal swabs were taken at birth, 6 and 12 months for bacterial culture. Multivariable and multivariate Poisson regression investigated associations between nasopharyngeal bacterial species and IAP/ETS. IAP exposures (particulate matter, carbon monoxide, nitrogen dioxide, volatile organic compounds) were measured at home visits. ETS exposure was measured through maternal and infant urine cotinine. Infants received the 13-valent pneumococcal and Haemophilus influenzae B conjugate vaccines. There were 881 maternal and 2605 infant nasopharyngeal swabs. Antenatal ETS exposure was associated with Streptococcus pneumoniae carriage in mothers (adjusted risk ratio (aRR) 1.73 (95% CI 1.03-2.92)) while postnatal ETS exposure was associated with carriage in infants (aRR 1.14 (95% CI 1.00-1.30)) Postnatal particulate matter exposure was associated with the nasopharyngeal carriage of H. influenzae (aRR 1.68 (95% CI 1.10- 2.57)) or Moraxella catarrhalis (aRR 1.42 (95% CI 1.03-1.97)) in infants. Early-life environmental exposures are associated with an increased prevalence of specific nasopharyngeal bacteria during infancy, which may predispose to LRTI.