Codexgeneral

Error: Address Already in Use After Codex Starts Your App

Your app won't start because the port is already taken, often by a copy Codex started earlier. How to find what is using the port and stop it.

2 min read Updated Applies to Codex

What is going on

You start your app and it fails with Error: listen EADDRINUSE: address already in use :::3000 (or another port number, such as 5173 or 8080).

Something is already using that port. After an AI coding tool has run your project, that is often a copy of your own app that it started and never stopped.

Error messages you might see

Error: listen EADDRINUSE: address already in use :::3000
Port 3000 is already in use
OSError: [Errno 48] Address already in use

Common causes

  1. An earlier run of your app, started by Codex or by you, is still running in the background.
  2. A terminal window or editor tab still has the dev server open.
  3. A different program on your computer uses the same port number.

How to fix it

  1. Find what uses the port. On Mac or Linux: lsof -i :3000. On Windows: netstat -ano | findstr :3000. Replace 3000 with your port.
  2. Look at the program name. If it is your own app (often shown as node), stop it with kill <PID> on Mac or Linux, or taskkill /PID <PID> /F on Windows.
  3. If it is another program you want to keep, start your app on a different port instead, for example PORT=3001 npm run dev.
  4. Close old terminal windows that still run a dev server.
  5. Start the app again.

Getting help takes about a minute

No hiring, no back and forth. A real person looks at your app.

  1. 1

    Describe it

    Tell us what you need in plain words. You don't have to be technical or have an account to start.

  2. 2

    Free 15-minute call

    A verified developer calls you. Many tasks are sorted right there, and it costs nothing.

  3. 3

    Pay after you approve

    If there is more to do, you get one fixed price up front. You pay only once you are happy.

Get help

Real people, reviewed by hand

Developers who do this every day

Every developer is approved by our team before they can take a task. Describe yours and the first one who is free picks it up.

Get help

Questions

Is it safe to stop that process?

Check its name first. If it is node and you know it is your own app, it is safe. If you do not recognise it, use another port instead.

Why does it keep happening?

Each time something starts your app without stopping the old copy, another one holds the port. Stop the old one before starting a new one.

Keep reading

Can't fix it yourself?
Real developers can help.

Get help