Buildings' energy accounts for one-quarter of greenhouse gas emissions, and if today's context continues, this share is predicted to rise. The low-carbon transition can be accomplished through energy-efficiency measures, behavioural interventions and incorporating carbon sinks such as urban parks. Cities and their energy systems should be resilient to natural and human threats.