While Africa was almost unurbanized one century ago, it has recently known dramatic urban growth. This is good news if cities are powerful engines of growth as emphasized by the economic geography literature. Yet, the agglomeration effects story was built on manufacturing and tradable services, two sectors underrepresented in African cities. We develop another story where agriculture-led rural windfalls feeds urban growth through consumption linkages, with a case study on cocoa production and cities in Ivory Coast and Ghana. We combine decadal district-level data on cocoa production and cities from 1921 to 2000, and we show how cities have followed the cocoa front. Our identification strategy uses the fact that cocoa is produced by ”eating” the virgin forest: (a) areas suitable to cocoa production are forested regions, i.e. the southern half of both countries, (b) for agronomic reasons, cocoa farmers move to a new forest every 25-50 years, this movement causing regional cycles, and (c) the cocoa front has started from the (South-)East of both countries. The cocoa front had to move westward, within the South. We can thus instrument cocoa production with a westward wave that we model. We find that cocoa production explains more than half of non-primate urbanization in both countries. We discuss and give evidence for the channels underlying this relationship, distinguishing what happens in new and old cocoa-producing regions.