Nontypeable Haemophilus influenzae (NTHi) is one of the leading causes of noninvasive mucosal infections, such as otitis media, sinusitis, and conjunctivitis. During its life cycle, NTHi is exposed to different CO2 levels, which vary from ~0.04% in ambient air during transmission to a new host to over 5% in the respiratory tract and tissues of the human host during colonization and disease. We used the next-generation sequencing Tn-seq technology to identify genes essential for NTHi adaptation to changes in environmental CO2 levels. It appeared that H. influenzae carbonic anhydrase (HICA), which catalyzes the reversible hydration of CO2 to bicarbonate, is a molecular factor that is conditionally essential for NTHi survival in ambient air. Growth of NTHi δ can strains was restored under 5% CO2-enriched conditions, by supplementation of the growth medium with sodium bicarbonate, or by genetic complementation with the can gene. Finally, we showed that HICA not only is essential for environmental survival but also appeared to be important for intracellular survival in host cells. Hence, HICA is important for NTHi niche adaptation.