Yes, you can install OpenAI Codex on Windows, and the "net" part of the question usually refers to network or connectivity errors that appear after installation. Codex ships as a CLI tool you install through npm (or through the Codex IDE extension), and most Windows problems come from Node.js not being on the PATH, PowerShell execution policy blocks, corporate proxies, or WSL being needed for the sandbox. This guide covers the install steps, the common network failures, and how to pick between the native Windows setup and WSL.
What Codex Actually Is on Windows
Codex is OpenAI's coding agent. It runs from a terminal, reads your repository, edits files, and runs commands in a sandbox, all under your approval. On Windows there are three practical ways to use it:
- The Codex CLI — a command-line agent installed with npm, aimed at developers who live in a terminal.
- The Codex IDE extension — integrates with editors such as VS Code, so the agent works inside the editor window.
- Codex cloud — tasks run in the browser against connected repositories, with no local install at all.
The CLI is the one that generates the most "install" and "net" questions, because it depends on Node.js, on outbound HTTPS access, and on a sandbox that behaves differently on Windows than on macOS or Linux.
Prerequisites Before You Type the Install Command
- Install Node.js. Use a current LTS release from the official Node.js site, which bundles npm. Check with
node -vandnpm -vin a fresh terminal. - Use Windows 10 or 11 on a 64-bit machine. Older builds and 32-bit Windows are not a supported target for modern Node.js releases.
- Have a ChatGPT plan or an API key. Codex sign-in can use a ChatGPT account on a plan that includes Codex, or an API key for pay-as-you-go usage.
- Open outbound HTTPS. The agent needs to reach OpenAI's API endpoints on port 443. If you are behind a corporate proxy or a strict firewall, sort that out before installing.
- Decide on native Windows or WSL. WSL2 gives you a Linux environment that matches the sandbox behaviour described in most documentation.
How to Install Codex on Windows
The straightforward path is a global npm install. Open PowerShell or Windows Terminal and run:
npm install -g @openai/codex- Then verify the binary is reachable:
codex --version - Start it inside a project folder:
codex - Follow the sign-in prompt, which opens a browser window for authentication and returns a token to the terminal.
If codex is "not recognized as an internal or external command," npm's global bin directory is not on your PATH. Run npm config get prefix, add that path (usually something like %APPDATA%\npm) to your user PATH, then open a new terminal. On some setups npm also needs a couple of extra tries because Windows locks files in the npm cache; closing editors and rerunning the install usually clears that.
For the IDE extension, install it from your editor's extension marketplace, sign in through the extension's own prompt, and confirm the agent panel appears. That route avoids PATH problems entirely and is the gentler start for people who rarely use a terminal.
Understanding the Network and Sandbox Model
The "net" in "codex net" is usually about what the agent is allowed to reach. Codex runs commands in a sandbox, and network access from inside that sandbox is restricted by default in many configurations — the agent can read and write your project files, but it cannot freely call the internet unless you approve it or enable network access for a session.
Two layers matter:
- The agent's own connection to OpenAI. This must work for the tool to do anything. A proxy, a VPN with split tunnelling, or TLS inspection by antivirus can break it.
- The commands the agent runs. When Codex runs
npm install,pip install, or a test suite that calls an API, that child process needs its own network permission. If it is blocked, you will see fetch errors, timeouts, or certificate errors inside the agent's output rather than at install time.
On native Windows the sandbox is weaker than on Linux, so treat approvals seriously: read the command before you accept it, and prefer running in a dedicated project folder rather than your whole user directory.
Common Install and Connection Problems
Most reports of Codex not working on Windows fall into a handful of buckets. Work through them in order:
- "codex is not recognized." PATH issue. Check
npm config get prefix, add the folder, restart the terminal. - npm install fails with EACCES or EPERM. Usually a locked file or permissions problem. Close editors, avoid running the terminal as administrator unless necessary, and retry. If a global prefix is inside a protected directory, set a user-writable prefix instead.
- PowerShell will not run the CLI. Execution policy may block scripts. Check
Get-ExecutionPolicyand adjust the policy for your user scope if your organisation permits it. - Sign-in opens a browser but the callback hangs. The local redirect is being blocked, often by a VPN or a firewall rule. Temporarily bypassing the VPN, or completing sign-in through the API key route, usually resolves it.
- Certificate or proxy errors. Corporate TLS inspection can break npm and the agent. Configure npm's proxy settings and make sure the corporate root certificate is trusted by both Node and Windows.
- Agent writes fail in WSL. Editing files on the Windows drive under
/mnt/cis slow and sometimes hits permission quirks; keep the repository inside the Linux filesystem for smoother behaviour.
A useful diagnostic order: confirm node -v works, confirm npm view @openai/codex version returns a version (this proves npm can reach the registry), then confirm codex --version, and only then try an interactive session. Each step isolates a different failure.
Native Windows vs WSL: How to Choose
The choice mostly comes down to how much you rely on Unix tooling.
- Choose native Windows if your projects are .NET, Node, Python with Windows wheels, or you mainly use the IDE extension. Setup is quicker and there is no Linux layer to maintain.
- Choose WSL2 if your projects assume bash, Make, Docker, or Linux-only dependencies, or if you want the stricter sandbox described in most Linux-oriented docs. The cost is a separate toolchain inside the distro and slower access to files on
C:. - Choose cloud tasks if you want to hand off work without a local install at all — useful on locked-down machines where you cannot install Node.js.
You can install Codex in both environments; they do not conflict as long as you install Node separately in the WSL distro rather than relying on the Windows copy.
Frequently Asked Questions
Is Codex available on Windows without WSL?
Yes. The CLI installs natively through npm and the IDE extension runs in Windows editors. WSL is optional and mainly helps if your projects depend on Linux tooling.
Why does Codex say it cannot reach the network?
The sandbox blocks outbound access from commands by default in many setups. Approve network access for the session, or grant the specific command permission when prompted. If the agent itself cannot connect at all, check your proxy, VPN, and firewall.
Do I need a paid ChatGPT plan to use Codex?
Codex access is tied to eligible ChatGPT plans or to API key billing. Check OpenAI's current documentation for which plan includes what, since entitlements change.
Why is "codex" not recognized after a successful install?
The global npm bin folder is not on your PATH. Add npm config get prefix to your user PATH and open a new terminal.
Can I use Codex behind a corporate proxy?
Usually yes, but both npm and the agent must be told about the proxy, and the corporate root certificate has to be trusted. Ask your IT team for the proxy address and certificate.
Is it safe to let Codex run commands on Windows?
Only with review. The Windows sandbox is less isolated than Linux, so keep repositories in a dedicated folder, read each command before approving it, and avoid running with elevated privileges.
Alternatives Worth Knowing
If the Windows setup keeps fighting you, consider the browser-based cloud version, which needs only a modern browser and a connected repository. Other terminal coding agents exist as well, and they have their own Windows quirks — some assume a Unix shell and effectively require WSL, while others ship a native installer. The pattern to remember is universal: a CLI agent needs a runtime, a working PATH, outbound HTTPS, and a policy decision about what it may execute. Solve those four and the rest is configuration.