Install and upgrade Codex on Linux

 

Install Codex on a Linux server with curl. To upgrade, stop the old app-server first, install the latest version, then reconnect from the local Codex App to refresh the model list.

1. Install Codex with curl

Run the installer on the Linux server:

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

If the installer URL fails with SSL_ERROR_SYSCALL, download the standalone binary from the official GitHub release instead. This also avoids installing Node.js or npm.

The following commands are for Linux x86-64 (uname -m returns x86_64):

(
  set -eu
  work_dir=$(mktemp -d)
  curl -fL --retry 3 \
    https://github.com/openai/codex/releases/latest/download/codex-x86_64-unknown-linux-musl.tar.gz \
    -o "$work_dir/codex.tar.gz"
  tar -xzf "$work_dir/codex.tar.gz" -C "$work_dir"
  mkdir -p "$HOME/.local/bin"
  install -m 0755 "$work_dir/codex-x86_64-unknown-linux-musl" "$HOME/.local/bin/codex"
)

export PATH="$HOME/.local/bin:$PATH"
command -v codex
codex --version

For Linux ARM64, replace x86_64 with aarch64 in both the download URL and extracted binary name. Releases are available on the official release page.

If ~/.local/bin is not already on your login shell’s PATH, add the following line to ~/.zshrc for Zsh or ~/.bashrc for interactive Bash:

export PATH="$HOME/.local/bin:$PATH"

2. Upgrade and restart the remote app-server

Follow this order: stop the old app-server → install the latest version → reconnect from the local Codex App.

First, wait for active Codex work to finish, then find the old server process on the Linux host:

ps -u "$(id -un)" -o pid,lstart,args | grep '[c]odex.*app-server'

Find the native Codex process whose arguments contain app-server --listen unix://. Use its PID from the first column, rather than the app-server proxy process. For example, if the server PID is 12345:

kill -TERM 12345

Replace 12345 with the PID from your own output. Stopping this server interrupts the Codex chats connected to it.

Next, rerun the curl installation commands in Section 1 to download and install the latest version. Then check the installed version:

codex --version

Finally, return to the local Codex App and reconnect to the remote host. The app starts the remote backend again. Open the model picker to check the updated model list; there is no need to manually run codex app-server.