The transition from a fossil-based energy economy to one based on renewable energy is driven by the double challenge of climate change and resource depletion. Building a renewable energy infrastructure requires an upfront energy investment that subtracts from the net energy available to society. This investment is determined by the need to transition to renewable energy fast enough to stave off the worst consequences of climate change and, at the same time, maintain a sufficient net energy flow to sustain the world's economy and population. We show that a feasible transition pathway requires that the rate of investment in renewable energy should accelerate approximately by an order of magnitude if we are to stay within the range of IPCC recommendations.