Sign in with ChatGPT - Address in use (os error 98)

Resolved 💬 5 comments Opened Aug 25, 2025 by MateuszZelent Closed Sep 3, 2025
💡 Likely answer: A maintainer (gpeal, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.23.0

Which model were you using?

_No response_

What platform is your computer?

WSL ubuntu20.04

What steps can reproduce the bug?

🐛 Bug report: "Address in use (os error 98)" during login

Description
When trying to launch Codex CLI and sign in (Sign in with ChatGPT or Provide your own API key), the following error appears:

Address in use (os error 98)

---

Additional context

  • Ports 8000, 3000, and 8080 are already in use on my system.
  • It looks like Codex CLI tries to start its local server on one of those ports.
  • I did not find any documented way to change the port manually (e.g. via --port flag or environment variable).

---

❓ Question: Is there currently any way to specify a different port for the login process?

What is the expected behavior?

_No response_

What do you see instead?

_No response_

Additional information

_No response_

View original on GitHub ↗

5 Comments

adsqx · 1 year ago

It’s right there in the README — it says to use localhost:1455.

MelmonVEVO · 11 months ago

I got the same issue on native Linux - I tried using ss to check if port 1455 was already in use on my system but it wasn't. I managed to log in properly by running codex login in the terminal directly.

argeeeee · 11 months ago

After trying many things from forums and even restarting PC and wsl many times, I finally found what the issue was for me. The culprit was windows NAT service who was blocking the 1455 port - among many others.

To see the ports that were blocked, I ran on a PowerShell with elevated privileges (admin):

netsh int ipv4 show excludedportrange protocol=tcp | findstr /r "^ *[0-9]"

Got:

Protocol tcp Port Exclusion Ranges

Start Port    End Port
----------    --------
      1056        1155
      1156        1255
      1256        1355
      1356        1455
      1456        1555
      1556        1655
      1656        1755
      1756        1855
      1874        1973
      1974        2073
      2180        2279
      2872        2971
      5000        5000
      5357        5357
     50000       50059     *

* - Administered port exclusions.

Seeing that the port was in one of the blocks, I stopped the winNat service with:

net stop winnat

and restarted it:

net start winnat

After doing this when I asked to sign in, it redirected me to OpenAI's page and got the Codex Cli working.

Hope this helps someone

gpeal contributor · 11 months ago

For future users who encounter this, per the above comments, 1455 is the port to free on your system if you are having login issues.

macOS

lsof -i :1455

Windows

netstat -ano | findstr :1455
shunexe · 11 months ago

In my case, closing Jet brains IDE solved the error.
I found a process used by jetbrains IDE is using the port by the command above. So I closed my Jetbrains IDE. After that, the error disappeared and I could signed in successfully. I hope this helps anyone using JetBrains IDE.