The Earth's surface can't be used to grow crops. They don't live in the ocean so there's no biomass there. There's no sunlight in a cave. So how did all those thousands of people feed themselves in Zion?
The Miller's Tale (archived link here) provides some information about Zion's food.
For the most part, Zion's population eats "protein-rich porridge" (although the comic does not say what it is made out of):
This is almost certainly the same porridge we see the crew of the Nebuchadnezzar eat in The Matrix.
Some life, mainly fungi, is able to survive on the Earth's surface:
The fungi is perhaps the source of the "protein-rich porridge".
At one time, the Zionists acquired wheat seeds from a repository and grew the wheat with UV light:
For a time, Zionists were able to grow wheat on the Earth's surface, but eventually the Machines found the farms and destroyed them. Nonetheless, Zion has some stockpiled grain and has a feast twice a year:
At the timeframe of the comic (Morpheus was a boy), there was hope that genetically modified wheat strains would eventually thrive:
By the time of the films (when Morpheus is an adult) it's possible that these genetically modified wheat strains have become a greater source of food for Zion.
With delicious fungi
In the city proper, the foods seen generally appear to be globular and brown, suggesting either a kind of fungi (which does not require sunlight to grow) or grain