Skip to content
NLEN
← Apps overview

Codex: installing and configuring

By Ivo Donker · — created with AI assistance (writer: DeepSeek V4.1 Flash; critic: Gemini 3.8 Flash + gpt-oss-120b via Groq)

Codex: ReviewInstall & set upNewsTechnical tutorial

As of September 2026, compiled from our own notes and news archive; text machine-generated and editorially checked. Check versions and commands in the official documentation.

In this guide you install Codex CLI, OpenAI's coding agent for the terminal, on macOS, Linux or Windows. You log in, choose a model and a safety level, and check that everything works. The commands come from the official documentation and OpenAI's repository (as of September 2026).

What you need

Installing on macOS and Linux

The official installer:

curl -fsSL https://chatgpt.com/codex/install.sh | sh

Alternatives:

brew install --cask codex          # Homebrew
npm install -g @openai/codex       # npm

You can also download a ready-made binary from the GitHub releases page for openai/codex, for example codex-aarch64-apple-darwin.tar.gz for a Mac with an Apple chip.

Then check:

codex --version

Installing on Windows

In PowerShell:

irm https://chatgpt.com/codex/install.ps1 | iex

If you mainly work with Linux tools, install Codex in WSL 2 using the Linux command above. In both places Codex uses a sandbox: the native Windows sandbox in PowerShell, the Linux sandbox in WSL 2.

Logging in

Start Codex in your project directory:

cd ~/mijn-project
codex

On first start, you choose between logging in with your ChatGPT account or an API key. If you want to work with a key, put it in the OPENAI_API_KEY environment variable and never commit it.

Sandbox on Linux

On macOS the sandbox works immediately (via Seatbelt). On Linux and WSL 2, Codex needs bubblewrap:

sudo apt-get install bubblewrap      # Debian/Ubuntu
sudo dnf install bubblewrap          # Fedora

The first settings that matter

1. Choose a model. Type /model in the session. As of September 2026, OpenAI recommends three models:

In the same menu you also set the reasoning level. The older gpt-5.5 disappears on 14 October 2026 for those who log in with a ChatGPT account.

2. Choose a safety level. Codex combines a sandbox with an approval policy. For beginners, this is the sensible combination:

codex --sandbox workspace-write --ask-for-approval on-request

Codex may then edit files in your project and run ordinary commands, but it asks first for everything outside that, such as internet access. If you only want it to observe, use --sandbox read-only.

3. Record the settings. Put your choices in ~/.codex/config.toml, then you don't have to specify them every time:

model = "gpt-6-sol"
approval_policy = "on-request"
sandbox_mode = "workspace-write"

4. Provide project instructions. Create an AGENTS.md in the root of your project with build commands, test commands and conventions. Codex reads that file in every session.

# AGENTS.md
- Build: `npm run build`
- Tests: `npm test` — draai ze voor elke commit
- Wijzig niets buiten `src/` zonder te vragen

Checking whether it works

A one-off, harmless command without an interactive session:

codex exec "Leg in drie zinnen uit wat dit project doet."

If a sensible answer comes back, then installation and login are working.

Updating

Update regularly. In September 2026, fixes appeared for two sandbox escapes, Heapjack and Overpatch; use at least CLI version 0.149.0.