Skip to main content

Installation

Codex CLI can be installed using npm, Homebrew, or by downloading pre-built binaries for your platform.

System requirements

Before installing Codex CLI, ensure your system meets these requirements:
RequirementDetails
Operating systemsmacOS 12+, Ubuntu 20.04+/Debian 10+, or Windows 11 via WSL2
Node.js16 or newer (Node 20 LTS recommended for npm installation)
Git (recommended)2.23+ for built-in PR helpers
RAM4 GB minimum (8 GB recommended)
Codex CLI does not work directly on Windows. You must use Windows Subsystem for Linux (WSL2). See the WSL installation guide.

Installation methods

1

Install globally with npm

Install Codex CLI globally using your preferred package manager:
npm install -g @openai/codex
Never run sudo npm install -g. If you encounter permissions errors, fix your npm permissions instead.
2

Verify installation

Verify that Codex is installed correctly:
codex --version
You should see the version number printed to your terminal.

Verify your installation

After installation, verify that Codex is working by running:
codex --help
You should see the help output with available commands and options.

Next steps

1

Authenticate

Now that Codex is installed, set up authentication to start using the CLI.
2

Complete the quickstart

Follow the quickstart guide to run your first commands.