Retinoic acid receptor-related orphan receptor γ (RORγt) controls the differentiation of naive CD4(+) T cells into the TH17 lineage, which are critical cells in the pathogenesis of autoimmune diseases. Here we report that during TH17 differentiation, cholesterol biosynthesis and uptake programs are induced, whereas their metabolism and efflux programs are suppressed. These changes result in the accumulation of the cholesterol precursor, desmosterol, which functions as a potent endogenous RORγ agonist. Generation of cholesterol precursors is essential for TH17 differentiation as blocking cholesterol synthesis with chemical inhibitors at steps before the formation of active precursors reduces differentiation. Upon activation, metabolic changes also lead to production of specific sterol-sulfate conjugates that favor activation of RORγ over the TH17-inhibiting sterol receptor LXR. Thus, TH17 differentiation is orchestrated by coordinated sterol synthesis, mobilization and metabolism to selectively activate RORγ.