Ultrahigh vacuum (UHV) surface science techniques are used to study the heterogeneous catalytic dehydrogenation of a liquid organic hydrogen carrier in its liquid state close to the conditions of real catalysis. For this purpose, perhydrocarbazole (PH), otherwise volatile under UHV, is covalently linked as functional group to an imidazolium cation, forming a non-volatile ionic liquid (IL). The catalysed dehydrogenation of the PH unit as a function of temperature is investigated for a Pt foil covered by a macroscopically thick PH-IL film and for Pd particles suspended in the PH-IL film, and for PH-IL on Au as inert support. X-ray photoelectron spectroscopy and thermal desorption spectroscopy allows us to follow in situ the catalysed transition of perhydrocarbazole to carbazole at technical reaction temperatures. The data demonstrate the crucial role of the Pt and Pd catalysts in order to shift the dehydrogenation temperature below the critical temperature of thermal decomposition.