We establish a framework for calculating the Hagedorn temperature of AdS5/CFT4 via integrability. Concretely, we derive the thermodynamic Bethe ansatz equations that yield the Hagedorn temperature of planar N=4 super Yang-Mills theory at any value of the 't Hooft coupling. We solve these equations perturbatively at weak coupling via the associated Y-system, confirming the known results at tree-level and one-loop order as well as deriving the previously unknown two-loop Hagedorn temperature. Finally, we comment on solving the equations at finite coupling.