Due to the rapid growth of cities in Africa, a larger number of farmers is living in the rural hinterland providing food to urban residents. However, empirical evidence on how urbanization affects these farmers is scarce. To fill this gap, this paper explores the relationship between proximity to a city and the production behavior of rural staple crop producers. More in particular, we analyze unique data from teff producing farmers in major producing areas around Addis Ababa, the Ethiopian capital. We find that farmers more closely located to Addis Ababa face higher wages and land rental prices, but because they receive higher teff prices they have better incentives to intensify production. Moreover, we observe that modern input use, land and labor productivity, and profitability in teff production improve with urban proximity. There is a strong and significant direct effect of urban proximity, which is suggested to be related with more use of formal factor markets, less transaction costs, and better access to information. In contrast, we do not find strong and positive relationships of rural population density increases - as an alternative source of agricultural transformation - as they seem to lead to immiserizing effects in these settings. Our results show that urban proximity should be considered as an important determinant of the process of agricultural intensification and transformation in developing countries.