Abstract We study the effects of quantum gravitational correction on the thermodynamics of black holes in the asymptotic safety scenario. Owing to the quantum-corrected Schwarzschild metric, the thermodynamic quantities are also corrected and a Hawking–Page-type phase transition may exist. We also employ the concept of thermodynamic geometry to the black hole to characterize the phase transition. By introducing a cavity enclosing the black hole, we apply the spatially finite boundary conditions to further investigate the thermodynamic phase transition of the black hole. It is shown that the larger and small black holes are both locally stable according to heat capacity. According to free energy, we find that the quantum-corrected black hole has similar thermodynamic phase structure to that of RN–AdS black hole. In addition, we also discuss the possibility of the phase transition between the black hole and the hot curved space. Above a certain temperature T0, the black hole is more probable than the hot space.