Microbial metabolic activity lies at the heart of the myriad of interactions between the environment and microorganisms that shape the dynamics of ecosystems. Earth is a closed system with a finite amount of matter that cycles between the lithosphere (the outer shell of the Earth), atmosphere, hydrosphere and biosphere, and microbial metabolism drives biogeochemical cycling between these spheres. This Nature Reviews Microbiology Focus on microbial biogeochemistry explores microbial metabolism in the context of wider ecosystems. It comprises Reviews that discuss the microbial nitrogen cycling network, the role that bacterial microcompartments have in atmospheric carbon fixation, the symbiotic exchange of nitrogen and carbon compounds between rhizobia and legumes and the function of hopanoid lipids, which are markers of ancient microbial life in sediments and as membrane components, mediate interactions between nitrogen-fixing bacteria and plants. It also features Research Highlights that showcase the latest research into the relationship between microbial metabolism and the environment.