Download Codex for Windows

On Windows, install the Codex CLI from a new PowerShell window with the official one-line installer from chatgpt.com. For a desktop app, install the ChatGPT desktop app from the Microsoft Store, or run winget install --id 9PLM9XGG6VKS -s msstore. The desktop app runs Codex natively in PowerShell with a Windows sandbox, or inside WSL2 if you switch it.

Applies to: Windows 11, Codex CLI, ChatGPT desktop app

Option 1: Codex CLI with the official installer

Open a new PowerShell window and run:

powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"

Run the same command later to update. Open a new terminal, change to your project folder, and run codex. Choose Sign in with ChatGPT the first time.

You can also install with npm (npm install -g @openai/codex) if you already use Node.js on Windows.

Option 2: The ChatGPT desktop app from the Microsoft Store

OpenAI ships the Windows desktop app through the Microsoft Store:

winget install --id 9PLM9XGG6VKS -s msstore

Then open the app, sign in, add a project, and choose Codex.

Native Windows or WSL2?

By default the desktop app uses the Windows-native Codex agent. Commands run in PowerShell, protected by a native Windows sandbox when you select Ask for approval below the composer. If you’d rather the agent ran in Linux, open Settings, switch the agent from Windows native to WSL, and restart the app.

OpenAI’s advice for the native agent is to keep projects on the Windows filesystem and reach them from WSL through /mnt/<drive>/.... Opening projects directly from \\wsl$\ is less reliable. Full walkthrough: Codex with WSL2.

Helpful tools to install first

Codex works best with a few developer tools already present. OpenAI’s Windows docs suggest:

winget install --id Git.Git
winget install --id OpenJS.NodeJS.LTS
winget install --id GitHub.cli

Git powers the review pane. Node.js and Python help the agent work efficiently. After installing GitHub CLI, run gh auth login to enable GitHub features.

Running Codex in full access mode means it isn’t limited to your project folder. OpenAI warns that this can lead to destructive actions and data loss. Keep the sandbox on unless you have a specific reason.

Questions people ask

Do I need WSL to use Codex on Windows?

No. The ChatGPT desktop app and the standalone CLI installer both support native Windows, with commands running in PowerShell. WSL2 is optional. Use it if your projects and tools already live in Linux.

Does Codex support WSL1?

No. According to OpenAI's Windows docs, WSL1 was supported through Codex 0.114. From 0.115 the Linux sandbox moved to bubblewrap, so you need WSL2.

Why does PowerShell say running scripts is disabled?

That's the PowerShell execution policy. See our fix for the 'cannot be loaded because running scripts is disabled' error before changing any system setting.

Sources

We link to the official source for every instruction on this page. If anything here disagrees with them, trust the official source and tell us.