New York City plans to roll out a food-composting program this fall as it attempts to cut the amount of waste that it ships to city landfills.

City leaders said a pilot program—launched in Staten Island—would now go to all five boroughs, where it is expected to reach more than 100,000 New Yorkers.

The program would be voluntary at first but...