For the terminal, run curl -fsSL https://chatgpt.com/codex/install.sh | sh on macOS and Linux, or powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex" on Windows. npm install -g @openai/codex and brew install --cask codex also work. For the desktop app, download the ChatGPT desktop app and switch to Codex mode. For the editor, install the openai.chatgpt extension. All four sign in with the same ChatGPT account.
- Terminal:
curl -fsSL https://chatgpt.com/codex/install.sh | sh. - Windows: the
install.ps1one-liner. No WSL required. - Homebrew ships it as a cask:
brew install --cask codex. - Desktop app = the ChatGPT desktop app. No separate Codex installer.
- Air-gapped or proxied? Take the release archive, or force GitHub with
CODEX_INSTALLER_USE_RELEASES_OPENAI_COM=false. - Every route ends at the same binary and the same
~/.codex.
Pick the surface first
Four downloads, one account. Verified August 2026.
| You want | Download | Platforms |
|---|---|---|
| Codex in a terminal | Codex CLI | macOS, Linux, Windows |
| A desktop workbench | ChatGPT desktop app | macOS (Apple Silicon), Windows |
| Codex beside your code | IDE extension openai.chatgpt | VS Code, Cursor, Windsurf |
| Nothing installed | Codex web | Any browser |
The CLI, five ways
The official installer (recommended)
curl -fsSL https://chatgpt.com/codex/install.sh | sh
codex --version
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
npm
npm install -g @openai/codex
# update
npm install -g @openai/codex@latest
The npm route needs Node 18 or newer, and it inherits the classic global-npm failure: upgrade Node and the command disappears, because the global prefix moved. If that happens, reinstall or switch to the standalone installer.
Homebrew
brew install --cask codex
# update
brew upgrade --cask codex
# where it went
which codex # $HOMEBREW_PREFIX/bin/codex
A release binary
Right choice for a locked-down machine, a container image, or any environment where piping a script into a shell is not allowed.
Assets on each GitHub release. Pick one.
| Platform | Asset |
|---|---|
| macOS, Apple Silicon | codex-aarch64-apple-darwin.tar.gz |
| macOS, Intel | codex-x86_64-apple-darwin.tar.gz |
| Linux, x86_64 | codex-x86_64-unknown-linux-musl.tar.gz |
| Linux, arm64 | codex-aarch64-unknown-linux-musl.tar.gz |
| Windows, arm64 | codex-aarch64-pc-windows-msvc.exe.zip |
V=rust-v0.147.0
A=codex-aarch64-apple-darwin
curl -fsSLO "https://github.com/openai/codex/releases/download/$V/$A.tar.gz"
tar -xzf "$A.tar.gz"
mv "$A" ~/.local/bin/codex
chmod +x ~/.local/bin/codex
codex --version
DotSlash, for pinning a team
Every release also carries a DotSlash file simply named codex. Commit it and every contributor runs the identical version on whatever platform they use, without anyone installing anything. This is the cleanest answer to "our CI and our laptops are on different Codex versions".
Which route to actually pick
They all end at the same binary, so this is a maintenance decision rather than a capability one. The differences show up months later, when something upgrades underneath you.
| Route | Best for | Fails when |
|---|---|---|
| Install script | Almost everyone | A proxy blocks both hosts |
| npm | Node shops with an existing global setup | You upgrade Node and the prefix moves |
| Homebrew | Macs where brew upgrade is already a habit | Nothing much, it is the tidiest on macOS |
| Release archive | Containers, locked-down machines, air gaps | Nobody remembers to update it |
| DotSlash | Teams that need one pinned version | You wanted per-developer freedom |
The npm row is the one worth taking seriously. A global npm install lives under whichever Node version prefix was active when you ran it, so a later Node upgrade makes the command vanish with no error, no missing file and no obvious cause. If you have already been bitten by that with another CLI, take the standalone installer and stop thinking about it.
In a Dockerfile, prefer the release archive over any script. It pins a version, adds no package manager to the image, and does not depend on a network host staying reachable at build time. Extract the archive, rename the single file inside it to codex, and put it on PATH.
One thing no route gives you is a signed guarantee across every platform. The Linux musl archives ship with matching .sigstore bundles on each release; the macOS and Windows assets do not carry one in the same form. If your policy requires provenance verification, that asymmetry is worth checking before you standardise on a route rather than after.
Where the installers actually fetch from
Worth knowing before you debug a corporate proxy. The standalone installers download from https://releases.openai.com/codex by default and fall back to GitHub Releases when metadata or an asset is unavailable. You can force the GitHub path:
curl -fsSL https://chatgpt.com/codex/install.sh | CODEX_INSTALLER_USE_RELEASES_OPENAI_COM=false sh
$env:CODEX_INSTALLER_USE_RELEASES_OPENAI_COM='false'; irm https://chatgpt.com/codex/install.ps1 | iex
Requirements, and what to check after
From the openai/codex repository, August 2026.
| Requirement | Detail |
|---|---|
| Operating system | macOS 12+, Ubuntu 20.04+ or Debian 10+, Windows 11 |
| RAM | 4 GB minimum, 8 GB recommended |
| Git | 2.23+, optional, needed for the built-in PR helpers |
| Node | Only for the npm route, 18+ |
| Account | ChatGPT Plus, Pro, Business, Edu or Enterprise, or an API key |
codex --version
codex doctor # diagnostic report
codex login # browser flow, uses your ChatGPT plan
codex login status # confirm which account is active
echo $OPENAI_API_KEY # should be EMPTY for subscription billing
That last line matters more than it looks. A stray OPENAI_API_KEY exported months ago for an unrelated script takes precedence over the subscription login, and you will pay per token while holding a plan that already covers it.
Updating and removing
| Installed with | Update | Remove |
|---|---|---|
| Install script | Re-run the script, or codex update | Delete the binary |
| npm | npm i -g @openai/codex@latest | npm uninstall -g @openai/codex |
| Homebrew | brew upgrade --cask codex | brew uninstall --cask codex |
| Release archive | Download the new one | Delete the binary |
| DotSlash | Commit a new DotSlash file | Delete the file |
Nothing above touches ~/.codex, so your config, credentials and transcripts survive a reinstall. The one exception is Homebrew's --zap, which deletes that directory on purpose.
Questions people ask
For the terminal run curl -fsSL https://chatgpt.com/codex/install.sh | sh on macOS or Linux, or the install.ps1 PowerShell one-liner on Windows. For the desktop app download the ChatGPT desktop app and switch to Codex mode. For your editor install the openai.chatgpt extension.
Not since July 2026. The standalone Codex app merged into the ChatGPT desktop app, where Codex is a mode alongside Chat and Work. One download covers both.
@openai/codex. Install it with npm install -g @openai/codex. It needs Node 18 or newer, and a later Node upgrade can move the global prefix and hide the command.
Yes, as a cask. brew install --cask codex installs the binary to $HOMEBREW_PREFIX/bin/codex and generates bash, zsh and fish completions. There is no Homebrew formula named codex.
Yes. Every GitHub release carries per-platform archives such as codex-aarch64-apple-darwin.tar.gz and codex-x86_64-unknown-linux-musl.tar.gz. Each archive contains a single file named for its platform, so rename it to codex after extracting.
Yes. The README ships a native PowerShell installer, and Windows binaries are published on every release. The repository requirements table still mentions WSL2, and sandboxing behaves differently between the two, so read the Windows guide before running anything unattended.
The installers fetch from releases.openai.com by default and fall back to GitHub Releases. One of those hosts is usually blocked. Set CODEX_INSTALLER_USE_RELEASES_OPENAI_COM=false to force GitHub, or download the release archive by hand.
Only where you want it to run. Codex web needs nothing installed, and the Remote feature lets a phone drive a desktop app already running on your own machine.
Sources
Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.
- openai/codex on GitHub README install commands, verified 7 August 2026
- openai/codex: installing and building
- Codex documentation: CLI
- Homebrew cask: codex