If you don't have access to Earth(but still the moon) or the Sun, where could you obtain enough hydrogen, oxygen, and nitrogen to create enough water and an N2 and O2 atmosphere for, say a population of 2 billion people? And you wouldn't be able to get materials from anywhere past Uranus. Would you be able to artificially mass produce these elements relatively easily?
Water- Can be obtained from pretty much any non-gas giant object beyond the middle of the asteroid belt. This includes comets, moons of outer solar system planets, even objects like Pluto, etc.
Nitrogen- The best source is Titan, although it can be found in a number of places.
Oxygen- Can be found where there is water, and is in quite a few other locations, if one has the energy to separate. For instance, it can be found on the Moon, Mars, etc.
The materials for life are quite abundant in the Solar System, one just has to look. The hardest is Nitrogen, but that is still available in the right places.