Run Codex inside WSL when the repository and the rest of your toolchain are already in Linux. The Windows and WSL installations are separate. A Windows Codex executable does not supply the command, configuration, or credentials inside Ubuntu.
Prepare WSL
Install WSL and a Linux distribution, then update its packages. Keep an active repository under a path such as ~/projects/my-app when possible. File-heavy agent work is usually slower across /mnt/c.
Install Codex inside Linux
Follow the current installation command in the official Codex repository. Run the installer inside WSL, then open a new shell and confirm that the command is available:
codex --version
Installation methods can change. Avoid copying an old package command when the official repository documents a different current release method.
Keep configuration in the WSL home
The main configuration path is:
~/.codex/config.toml
Keep this file in the Linux home directory. Do not point the WSL installation at the Windows .codex directory unless you understand which client will modify it.
Authenticate or add a provider
Use the official sign-in flow for OpenAI-backed Codex. For another provider, follow that provider’s current Codex integration guide. A provider must match Codex’s expected API protocol and tool behavior; an OpenAI-style base URL alone does not prove compatibility.
DeepSeek’s current Codex setup uses the Responses API, wire_api = "responses", and a custom models.json catalog. See DeepSeek V4 with Codex for the complete configuration.
Start from the repository
cd ~/projects/my-app
codex
Begin with a read-only request. Confirm the selected model and provider in the startup information or provider usage records before allowing edits.
Common problems
codexis missing: install it inside the current WSL distribution and open a new shell.- Configuration changes do not apply: confirm that you edited the Linux
~/.codex/config.toml, then restart Codex. - The provider returns a protocol error: compare
wire_api, base URL, and model catalog with the provider’s current Codex guide. - File operations are slow: move the active repository from
/mnt/cto the Linux home directory. - The Windows app and WSL CLI behave differently: they may be reading different configuration directories.
Codex in WSL checklist
- Codex installed inside the WSL distribution
- Configuration stored under the Linux home directory
- Existing Codex files backed up before provider changes
- Active repository kept in Linux when practical
- Read-only request tested before edits