June 23, 2026 · by Meegrow Labs

How to Restart a Node Server (Stop and Restart)

You start your server, it runs, and you make a small change to your code. You refresh the page and… nothing looks different. The change is right there in your file, so why isn’t it showing up?

To restart a Node server, press Ctrl+C in the terminal to stop the running server, then run node server.js again to start it fresh. The old server keeps serving the old code until you stop and restart it, so knowing how to restart a Node server is what makes your changes actually appear.

Why don’t my code changes show up?

When you start a server, it loads your code once and keeps running with that copy in memory. Editing the file on disk doesn’t change the version the server is already running.

Think of a stove. To cook something new, you turn it off first, make your change, then light it again. A running server works the same way. It’s holding the current dish; you have to stop it before the next one.

So the page looks the same not because your edit failed, but because the old server is still serving the old code.

How do I stop a running server?

A running server takes over your terminal. You’ll notice you can’t type new commands while it’s busy listening for requests. That’s normal.

To free the terminal and stop the server, press Ctrl+C (hold the Control key and press C). This sends a stop signal, the server shuts down, and your command prompt comes back.

Ctrl+C

Once you see the prompt again, you’re free to edit files or run new commands.

How do I restart a Node server after a change?

Restarting is just starting again. After you’ve stopped the server, run the same command you used the first time:

node server.js

This launches a fresh server that loads your updated code. Now refresh the page and your change will be there. That’s the whole answer to how to restart a Node server: stop with Ctrl+C, then run it again.

What is the edit, stop, restart loop?

Every developer follows the same small rhythm while building. It looks like this:

  • Edit — change your code and save the file.
  • Stop — press Ctrl+C to stop the old server.
  • Restart — run node server.js to start it fresh.

Then you check the page, and the cycle begins again. This edit, stop, restart loop is the basic heartbeat of building software, and you’ll repeat it hundreds of times.

Can I try it right now?

Yes, and it takes ten seconds. With your server still running in the terminal:

  • Press Ctrl+C to stop it — watch the command prompt return.
  • Run node server.js again to bring it back.

You just did a full stop and restart. Once this feels natural, you’ll never wonder again why a change isn’t showing up.

Key takeaways

  • A running server loads your code once and keeps serving the old version until you restart it.
  • Press Ctrl+C to stop the server and free your terminal.
  • Run node server.js again to restart with your updated code.
  • The everyday build rhythm is simple: edit, stop, restart.

This stop-and-restart habit carries straight into the rest of your journey. Ready for what’s next? You can learn step by step with the free Zero to AI Hero course and put it all together in the Level 7 challenge.


🚀 Take the full free course: Zero to AI Hero — learn to build with AI from scratch. New lessons daily, in Hindi & English.

Meegrow Labs

We help India go from zero to AI hero — learn to use & build with AI from scratch, in Hindi & English. Start the free course →

Want to actually learn this?

151 free 2-minute lessons — from "what's a file?" to building with AI.

▶ Start the free course