A practical guide to run the Codex desktop payload (from Codex.dmg) on Linux/Ubuntu.
This repository ships scripts and documentation only. It does not redistribute proprietary Codex binaries.
Codex.dmg is built for macOS. This project provides a Linux bridge that helps you:
- extract the required content from
Codex.dmg - run the Electron payload on Linux
- wire it to the correct
codexCLI binary
- You must have your own
Codex.dmgfrom the official source. - This repo does not include DMG/app binaries.
- If anything does not match your machine, check
docs/TROUBLESHOOTING.md.
- Ubuntu/Linux x64
bashgitnode+npm+npx7z(to extract DMG contents)codexCLI
Install dependencies on Ubuntu:
sudo apt update
sudo apt install -y p7zip-full git curlVerify your environment:
node -v
npm -v
npx -v
codex --versiongit clone https://github.com/Mina-Sayed/codex-dmg-linux-bridge.git
cd codex-dmg-linux-bridge
chmod +x scripts/codex-dmg-linux-launcher.shDownload Codex.dmg from your official account source, then place it on Linux.
Example:
mkdir -p "$HOME/codex-dmg-attempt-latest"
cp /path/to/Codex.dmg "$HOME/codex-dmg-attempt-latest/Codex.dmg"The launcher expects a workdir containing:
asar-unpacked/tools/node/runtime/bin/npx
cd"$HOME/codex-dmg-attempt-latest"
7z x Codex.dmg -oextractFind app.asar:
APP_ASAR="$(find extract -type f -name app.asar | head -n 1)"echo"$APP_ASAR"If the path is valid, extract it:
npx --yes @electron/asar extract "$APP_ASAR" asar-unpackedIf missing, symlink to your system npx:
mkdir -p tools/node/runtime/bin
ln -sf "$(command -v npx)" tools/node/runtime/bin/npxCheck all installed Codex binaries:
which -a codex
codex --versionIf you have multiple binaries, use the newest one (example):
/home/linuxbrew/.linuxbrew/bin/codex
codex loginFrom this repo directory:
CODEX_DMG_WORKDIR="$HOME/codex-dmg-attempt-latest" \
CODEX_CLI_PATH="/home/linuxbrew/.linuxbrew/bin/codex" \
./scripts/codex-dmg-linux-launcher.shQuick app-server validation:
codex debug app-server send-message-v2 "reply with one word: ok"Expected final response contains: ok.
mkdir -p ~/.local/bin
cp scripts/codex-dmg-linux-launcher.sh ~/.local/bin/codex-dmg-linux
chmod +x ~/.local/bin/codex-dmg-linuxRun it from anywhere:
CODEX_DMG_WORKDIR="$HOME/codex-dmg-attempt-latest" \
CODEX_CLI_PATH="/home/linuxbrew/.linuxbrew/bin/codex" \
~/.local/bin/codex-dmg-linuxMissing app payload at .../asar-unpackedapp.asarwas not extracted correctly.
Missing Node runtime at .../tools/node/runtime/bin- Create the
npxsymlink step in section 6.3.
- Create the
Unable to locate the Codex CLI binary- Set
CODEX_CLI_PATHto a validcodexbinary.
- Set
model_not_found- Usually wrong/old CLI binary or incompatible model configuration.
More details: docs/TROUBLESHOOTING.md.
scripts/codex-dmg-linux-launcher.sh: main Linux launcherdocs/SETUP.md: additional setup notesdocs/TROUBLESHOOTING.md: fixes for common issues
MIT (see LICENSE).