Ramming paste is a particular type of carbon paste which is used as lining for electric smelting furnaces and Hall-Héroult cells for the production of aluminium. The purpose of this lining is to form an impenetrable barrier, keeping the liquid within the furnace. If the lining has cracks or holes, then liquid can escape, which can lead to safety risks and financial losses, so the integrity of the lining is of great importance. In the present study, we develop a first principles mathematical model for the heat and mass transfer processes occurring during the baking of carbon paste. We then obtain numerical simulations using this model and compare the simulation results to experimental data, demonstrating that the model solutions do indeed describe and predict realistic behaviours of the carbon paste baking process. The simulations indicate a strong pressure buildup during the evaporation of water from fresh paste during the baking process, which is likely to lead to cracking of the paste as it hardens. Furthermore, we are able to show that more gradual heating during the baking process can lower the maximal pressures predicted by the model, which in turn may reduce the prevalence of cracks within the hardened paste.