Most developed countries will be facing severe public budget constraints. We examine how extraction or use of nonrenewable resources should be taxed when governments need to collect commodity tax revenues. Moreover, we show how our results can be directly used to indicate how carbon taxation of nonrenewable energy sources should be increased in the presence of public-revenue needs. The obtained tax formula is an augmented, dynamic version of the standard Ramsey taxation rule. It distorts developed reserves, which are re-duced, and their depletion, which is slowed down, going further in the direction prescribed for the resolution of the climate externality. We present a simple calibrated application of our results to illustrate how carbon taxation of oil should be strongly augmented, and the incidence of this adjustment on oil use and tax revenues.& COPY; 2023 The Authors. Published by Elsevier B.V. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/).