Codex Installation
Prerequisites, installation methods, and Windows/WSL considerations
Codex installs through package managers or as a standalone binary. The CLI is written in Rust, enabling zero-dependency native binaries across all platforms.
Prerequisites
Codex requirements vary by installation method:
- Operating system macOS 10.15+, Linux (x86_64 or ARM64), or Windows 10+ with WSL
- Node.js Version 22+ (only required for npm installation)
- Internet Required for authentication and API access
Native binaries and Homebrew cask installations have no runtime dependencies.
Installation methods
Homebrew (Recommended)
brew install --cask codexThe cask installs a native binary without Node.js dependencies. Works on macOS and Linux.
npm
npm install -g @openai/codexThis method requires Node.js 22 or later earlier versions fail during installation.
Native Binary
Pre-compiled binaries are available from the GitHub releases page for:
- macOS (Intel and Apple Silicon)
- Linux (x86_64 and ARM64)
- Windows
Download the appropriate archive, extract, and add to PATH.
Windows considerations
Native Windows support includes an experimental sandbox. WSL provides a more predictable environment matching Linux tooling.
- Open PowerShell as Administrator and run
wsl --install - Within WSL, install Node.js 22 via nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash nvm install 22 - Install Codex:
npm install -g @openai/codex
Store repositories in the Linux filesystem (~/code/) rather than /mnt/c/ for better performance.
Verifying installation
After installation, launch Codex:
codexThe first run prompts for authentication. To update, run npm install -g @openai/codex@latest or brew upgrade --cask codex.