Earth is the one known example of an inhabited planet and to current knowledge the likeliest site of the one known origin of life. Here we discuss the origin of Earth's atmosphere and ocean and some of the environmental conditions of the early Earth as they may relate to the origin of life. A key punctuating event in the narrative is the Moon-forming impact, partly because it made Earth for a short time absolutely uninhabitable, and partly because it sets the boundary conditions for Earth's subsequent evolution. If life began on Earth, as opposed to having migrated here, it would have done so after the Moon-forming impact. What took place before the Moon formed determined the bulk properties of the Earth and probably determined the overall compositions and sizes of its atmospheres and oceans. What took place afterward animated these materials. One interesting consequence of the Moon-forming impact is that the mantle is devolatized, so that the volatiles subsequently fell out in a kind of condensation sequence. This ensures that the volatiles were concentrated toward the surface so that, for example, the oceans were likely salty from the start. We also point out that an atmosphere generated by impact degassing would tend to have a composition reflective of the impacting bodies (rather than the mantle), and these are almost without exception strongly reducing and volatile-rich. A consequence is that, although CO-or methane-rich atmospheres are not necessarily stable as steady states, they are quite likely to have existed as long-lived transients, many times. With CO comes abundant chemical energy in a metastable package, and with methane comes hydrogen cyanide and ammonia as important albeit less abundant gases.