This paper presents the first investigation of the effects of optimal energy taxation in an urban spatial setting. Rather than exploring the effects of a carbon tax, our approach is to derive the supplements to existing taxes that are needed to support the social optimum. We then analyze the effects of these taxes on urban spatial structure. Emissions are generated by housing consumption and commute trips, and the optimal tax structure has a tax on commuting, housing floor space, and land. These taxes reduce the extent of commuting and the level of housing consumption while increasing building heights, generating a more-compact city with a lower level of emissions per capita.