Codex refers to a family of developer tools rather than a single program, so "installing Codex on Windows" means different things depending on which one you want. For most people it is either the OpenAI Codex command-line tool or IDE extension, installed through npm and a Node.js runtime, or a ChatGPT desktop app on Windows that exposes Codex as a feature. There is no traditional Windows installer you download and double-click for the CLI; setup happens in a terminal, and the main skill involved is getting Node.js and package permissions right.
What "Codex" Actually Refers To
The name has been reused across product generations, which is the source of most confusion. Today it usually points to one of these:
- Codex CLI — a terminal-based coding assistant distributed as an npm package. It runs in PowerShell, Windows Terminal, or any shell and reads and edits files in your project.
- Codex IDE extension — an extension for editors such as VS Code and compatible forks, installed from the editor's extension marketplace.
- Codex inside ChatGPT — coding features in the ChatGPT desktop app and web interface, which do not require a separate install beyond the app itself.
- Historical Codex models — older models that were superseded and cannot be "installed" at all. If a guide you found is several years old, check whether it is describing a product that no longer exists.
A second common misconception is that Codex is a full offline application. It is not. Every variant connects to hosted models over the internet and requires an authenticated account, so a working network connection and a valid sign-in are as essential as the software itself.
Prerequisites Before You Start
Windows support for the command-line tool has improved, but it still assumes a Unix-like environment in places. Prepare the following first:
- A modern 64-bit Windows version. Windows 10 and 11 both work; very old builds may lack required terminal features.
- Node.js in a current LTS release plus npm. The installer from the official Node.js site includes npm automatically.
- A real terminal. Windows Terminal or PowerShell works well. The classic Command Prompt occasionally handles colour output and input prompts poorly.
- Git for Windows, if you want Codex to work inside repositories and show diffs cleanly.
- WSL, optionally. Windows Subsystem for Linux gives you a Linux shell where the tool behaves closest to documented Unix instructions.
- An account with access to the service. Sign-in happens through a browser flow or an API key.
Verify Node.js before installing anything else by opening a terminal and running node --version and npm --version. Both should print version numbers. If either command is not recognised, the PATH was not updated and a restart of the terminal (or of Windows) is usually enough.
Installing the Codex CLI Step by Step
The standard route is a global npm install. In a terminal, run:
npm install -g @openai/codexto install the package globally.- Run
codex --versionto confirm the binary is on your PATH. - Start it inside a project folder with
codexso it treats that directory as its working context. - Complete the authentication prompt: choose the browser sign-in option and approve access, or paste an API key if you are using key-based billing.
If the global install fails with a permissions or EACCES error, avoid the instinct to run the terminal as Administrator. Global installs as an elevated user can create files that your normal account cannot update later. A cleaner fix is to set a user-level npm prefix directory that your account owns, or to use a Node version manager that keeps global packages inside your home folder. On Windows the npm global prefix is normally under %APPDATA%\npm, which should already be writable by your own account, so permission errors often mean the install was attempted from an elevated shell or from a restricted company profile.
Symlink problems are a Windows-specific wrinkle. Some npm versions refuse to create command shims without developer mode or the right policy. Enabling Developer Mode in Windows Settings, or using PowerShell with the appropriate execution policy for your scripts, resolves most of these messages.
Using Codex in an Editor Instead
Many Windows users never touch the CLI and prefer the editor extension, which avoids npm entirely:
- Open VS Code or a compatible editor and go to the Extensions view.
- Search for the official Codex extension and confirm the publisher is the one named in the vendor's documentation.
- Install, then sign in when the extension prompts you.
- Open a folder so the assistant has a workspace, then use the panel or command palette to start a session.
The extension brings its own bundled runtime in most cases, so Node.js may not be needed. It also keeps changes visible as editor diffs, which is easier to review than terminal output for many people.
Common Problems and How to Fix Them
Most Windows failures fall into a handful of patterns:
- "codex is not recognized" — the npm global bin folder is missing from PATH. Check
npm config get prefix, add that folder plus its parent to your user PATH, and open a fresh terminal. - Install hangs or fails behind a proxy — corporate networks often block npm registry traffic. Configure npm's proxy settings or use the registry mirror your IT team provides.
- Login loop — a browser opens but the callback never completes. Try signing in with a different default browser, or use the API key method instead of the browser flow.
- File edits propose Unix paths — this is the strongest argument for running inside WSL, where path handling matches the tool's expectations.
- Antivirus interference — security software sometimes quarantines newly created executables. Check the protection history if installs seem to succeed but no command appears.
- Outdated Node version — old releases cause cryptic syntax errors. Update to a current LTS build before troubleshooting further.
CLI Versus Editor Extension: How to Choose
Pick the CLI when you want scriptable, repo-wide work, when you are comfortable in a terminal, or when you want the assistant to reason across many files in a repository. Pick the extension when you want visual diffs, inline suggestions, and a gentler learning curve. Running both is common: the extension for quick edits and the CLI for larger tasks. Users who already live in WSL should install inside the Linux environment rather than on the Windows side, because crossing the filesystem boundary between Windows and Linux directories slows file operations and can complicate permissions.
Costs and Access
None of the Codex tooling is a paid download; the software is free to install. What costs money is the underlying model access. Depending on the plan you use, requests may be included in a subscription or billed per token through an API account. Check current pricing and plan inclusions in your account settings rather than relying on older blog posts, since plan structures change. Reviewing usage limits before starting large tasks avoids surprise charges on metered accounts.
Staying Safe While It Edits Your Files
An assistant that can write files deserves the same caution as any script. Practical habits:
- Work in a Git repository and commit before starting so you can review and revert changes.
- Read proposed diffs before accepting them, especially for configuration, build, or credential-adjacent files.
- Keep secrets out of prompts; do not paste API keys, passwords, or customer data into a session.
- Be deliberate about approval modes that let the tool run commands automatically.
- Avoid running it against production systems or sensitive directories without a backup.
Frequently Asked Questions
Is there an .exe installer for Codex? No standalone Windows installer exists for the CLI. You install it through npm or use the editor extension. The desktop app is installed like any other Windows application but is a separate product.
Do I need WSL to run Codex on Windows? Not strictly. The CLI can run in PowerShell or Windows Terminal. WSL is recommended when you want behaviour that matches Unix documentation, better path handling, and fewer shell quirks.
Why does the command fail after a successful install? Almost always a PATH issue. The global npm bin directory is not visible to your shell. Confirm the prefix path, add it to the user PATH, and reopen the terminal.
Can I use Codex offline? No. It depends on hosted models and requires an internet connection and a signed-in account for every session.
Is the old Codex model still installable? Older Codex models were retired and are not available for local installation. Current tooling uses the vendor's newer models under the same product name.