The Moon does not possess an internally generated magnetic field at the present day, but extensive evidence shows that such a field existed between at least 4.2 and 3.56 Ga ago. The existence of a metallic lunar core is now firmly established, and we investigate the influence of inner core growth on generating a lunar core dynamo. We couple the results of a 3-D spherical thermochemical convection model of the lunar mantle to a 1-D thermodynamic model of its core. The energy and entropy budget of the core are computed to determine the inner core growth rate and its efficiency to power a dynamo. Sulfur is considered to be the main alloying element and we investigate how different sulfur abundances and initial core temperatures affect the model outcomes. For reasonable initial conditions, a solid inner core between 100 and 200 km is always produced. During its growth, a surface magnetic field of about 0.3 μT is generated and is predicted to last several billion years. Though most simulations predict the existence of a core dynamo at the present day, one way to stop magnetic field generation when the inner core is growing is by a transition between a bottom–up and top–down core crystallization scheme when the sulfur content becomes high enough in the outer core. According to this hypothesis, a model with about 6 to 8 wt.% sulfur in the core would produce a 120–160 km inner core and explain the timing of the lunar dynamo as constrained by paleomagnetic data.