If you were to attempt to raise a garden utilizing only lunar or Martian soil, chances are that your precious plants would either die a horrible death or survive albeit malnourished.
While there are probably exceptions to this rule (i.e. asparagus might be able to thrive within Martian dirt), the vast majority of terrestrial plants will need terrestrial soil in order to thrive, which poses a huge problem for humanity (as people need to eat off world, let alone find employment).
Instead of importing tons of terrestrial soil from the homeworld or manufacturing large quantities from humans, it’s probably wiser to raise them without soil thanks to aeroponics.
Growing plants without any soil may conjure up images from a Star Trek movie, but it’s hardly science fiction. Aeroponics, as one soilless cultivation process is called, grows plants in an air or mist environment with no soil and very little water. Scientists have been experimenting with the method since the early 1940s, and aeroponics systems have been in use on a commercial basis since 1983.
“Who says that soil is a precondition for agriculture?” asked Graber. “There are two major preconditions for agriculture, the first being water and the second being plant nutrients. Modern agriculture makes extensive use of ‘soilless growing media,’ which can include many varied solid substrates.”
In 1997, NASA teamed up with AgriHouse and BioServe Space Technologies to design an experiment to test a soilless plant-growth system on board the Mir Space Station. NASA was particularly interested in this technology because of its low water requirement. Using this method to grow plants in space would reduce the amount of water that needs to be carried during a flight, which in turn decreases the payload. Aeroponically-grown crops also can be a source of oxygen and drinking water for space crews. (Astrobiology Magazine)
Using Aeroponics would not only reduce the overall cost of raising grain, but enable us to establish “self sustaining” colonies beyond the Jovain lunar worlds (such as Callisto, Ganymede and Saturn’s Titan), but also upon asteroids and Centaurs (aka giant comets like Chiron) as well.
While aeroponics would not be feasible for every time of plant available (i.e. raising forests would require tons of soil), it would make it easier to settle upon the worlds that dance around our yellow sun which would aid humanities quest to conquer the final frontier.