Free toolsFix “address already in use” for wrangler dev

Fix “address already in use” for wrangler dev

Pick the port from your error message and get the exact commands to find the process holding it, stop it, or run on a different port.

1. Find what is using the port

2. Stop it

3. Or run on a different port

Leftover workerd processes

Why this happens

wrangler dev listens on port 8787 by default, and also opens an inspector port, 9229 by default. If a previous run did not exit cleanly, for example because you closed the terminal tab, the old wrangler or workerd process can keep holding the port, and the next start fails with EADDRINUSE or "address already in use".

Common default ports

PortUsed by
8787wrangler dev (the Worker itself)
9229The inspector used by wrangler dev
4321astro dev
5173Vite dev server, also used with the Cloudflare Vite plugin

Change the port for good

Pass --port and --inspector-port on the command line, or set them in your Wrangler config under dev:

[dev]
port = 8788
inspector_port = 9230

Frequently asked questions

Is it safe to kill the process?
Check the output of step 1 first. If it is node, wrangler or workerd from your own project, it is safe. If it is something you do not recognise, leave it alone and use a different port.

The port looks free but I still get the error.
Check the other port too. wrangler dev needs both the main port and the inspector port to be free.

Stop playing port roulette.

WorkerDock picks a free port for every project, shows what is running where, and stops a project's whole process group, including workerd, when you click Stop.

v0.1.2 · macOS 14+ · Free