Latent heat thermal energy storage (LTES) has been recommended to complicated aerospace systems due to the excellent ability of storing thermal energy in recent years. Metal foam, as an effective additive to enhance the effective thermal conductive coefficient of phase change materials, has been wildly used in the LTES system. In support of the future space exploration, solid–liquid phase change within metal foam under different gravitational accelerations and corresponding heat transfer characteristics are investigated in this work to enhance understanding of heat transfer capability in reduced gravity conditions. A pore-scale lattice Boltzmann method with the double distribution functions is developed to study the solid–liquid phase change problems with the natural convection heat transfer in metal foam. Here, microstructure of metal foam is experimentally obtained by the use of X-ray computed tomography. Two numerical validation cases are performed, one for fluid–solid conjugate heat transfer problem, and the other for melting process in a square cavity without the porous media. The presented lattice Boltzmann results are in good agreement with previous analytical and numerical results. Based on the analysis of temperature and velocity fields during melting within metal foam, it is found that the clockwise circulation, caused by the temperature gradient, leads to the inhomogeneous distribution of liquid–solid interface along vertical direction. What’s more, gravity effects on the temperature and velocity fields together with the average Nusselt number and liquid fraction coefficient are investigated. Results show that with the decrease of gravitational accelerations from 1g to 0g, the maximum vertical velocity reduces and the thickness of velocity boundary layer thickens accordingly, and results in the pronounced reduction of average Nusselt number and melting rate. The natural convection appears to be even more tenuous as gravitational acceleration decreases, leading to the dominant heat transfer mechanism transited from convection to conduction, and finally alleviating the phase change process. The liquid fraction under 0g, 0.01g and 0.1g conditions are 54.6%, 58.9% and 67.9% respectively of that under 1g conditions at Fo = 0.06. In addition, porosity effects on phase change heat transfer characteristics are discussed by comparing the liquid fraction with porosity of 0.9, 0.94 and 1. It is found that metal foam with lower porosity shows higher effective thermal conductivity and outstanding heat transfer performance, while the restriction on natural convection should not be neglected, especially for melting region which is dominated by natural convection.