Using renewable sources to generate energy is an approach to realize a sustainable energy system. Utilizing gasification slag, a solid waste from the coal gasification process, as a porous material not only substantially increases the value of the waste but also enhances thermal performance. This study develops a novel shape-stabilized coal gasification slag/paraffin (CGS-P) phase-change material for use in cement mortar to reduce indoor temperature fluctuations. Using a simple impregnation method, paraffin is incorporated into porous coal gasification slag to produce CGS-P. Coal gasification slag containing 30 % paraffin (CGS-P(30 %)) can maintain its structure without leakage at 60 °C. The thermal and chemical characteristics as well as the specific surface area of CGS-P(30 %) are characterized via X-ray diffraction (XRD), Fourier-transform infrared (FT-IR) spectroscopy, Brunauer–Emmett–Teller (BET) analysis, differential scanning calorimetry (DSC), thermogravimetric analysis (TGA), and scanning electron microscopy (SEM)–energy-dispersive X-ray spectroscopy. The results of XRD and FT-IR analyses indicate that CGS-P(30 %) is a combination of paraffin and CGS, with no new substances formed. Furthermore, the BET, SEM, and TGA results confirm that the pores in CGS can effectively encapsulate approximately 30 % paraffin and that CGS-P(30 %) exhibits good thermal stability. The DSC analysis results show that CGS-P(30 %) has suitable phase-change temperatures and latent heat (18.02 °C and 59.30 J/g, respectively, during the endothermic phase). Furthermore, incorporating 30 % CGS-P(30 %) into the cement mortar (CESCM30) results in good mechanical and thermal performance. Particularly in hot climates, CESCM30 can notably reduce indoor temperatures, alleviate indoor cooling energy consumption, and indirectly reduce CO2 emissions. Therefore, CGS derived CGS-P is a promising material for accommodating solar thermal energy.