The skyrmion racetrack is a promising concept for future information technology. There, binary bits are carried by nanoscale spin swirls-skyrmions-driven along magnetic strips. Stability of the skyrmions is a critical issue for realising this technology. Here we demonstrate that the racetrack skyrmion lifetime can be calculated from first principles as a function of temperature, magnetic field and track width. Our method combines harmonic transition state theory extended to include Goldstone modes, with an atomistic spin Hamiltonian parametrized from density functional theory calculations. We demonstrate that two annihilation mechanisms contribute to the skyrmion stability: At low external magnetic field, escape through the track boundary prevails, but a crossover field exists, above which the collapse in the interior becomes dominant. Considering a Pd/Fe bilayer on an Ir(111) substrate as a well-established model system, the calculated skyrmion lifetime is found to be consistent with reported experimental measurements. Our simulations also show that the Arrhenius pre-exponential factor of escape depends only weakly on the external magnetic field, whereas the pre-exponential factor for collapse is strongly field dependent. Our results open the door for predictive simulations, free from empirical parameters, to aid the design of skyrmion-based information technology.