In this study, we propose a thermally stable memristor with nitrogen-doped hafnium oxide (HfO:N)-based resistive switching (RS) memory. The memristor with HfO:N as an active layer showed only a 7% change in the resistance in the high resistance state (HRS) after post-metal annealing (PMA) at 400 °C for 1 h. In contrast, the HfO2-based memristor exhibited an 83% change in the resistance at HRS after PMA at 400 °C for 1 h and lost RS operating characteristics after PMA over 400 °C. In addition, although the resistance of the HRS decreased by 80% after PMA at 550 °C for 1 h, the HfO:N-based memristor showed that the RS operation was maintained up to 550 °C. Through the nitrogen doping technique, a thermal budget of 550 °C can be achieved, which is one of the highest thermal budgets in RS memory with PMA. Such thermal stability enhancement of the memristor is a result of nitrogen doping, which improves the structural stability of the active layer and suppresses the generation of oxygen vacancies in the active layer. This experimental approach can facilitate the development of advanced memristor devices with a good thermal budget of up to 550 °C.