Codex on Linux with multiple accounts
Keep several OpenAI accounts on one Linux machine and select which one the Codex CLI uses next. The CodexUse desktop app now ships for Linux, and the CodexUse CLI covers the shells, SSH sessions, and headless boxes where a window manager is not an option.
linux-x64-CodexUse-Setup.tar.gz or linux-arm64-CodexUse-Setup.tar.gz. It manages
unlimited accounts, custom-model accounts, Account Pool, and headroom and refill timers.
One Codex window per account and Auto-roll drive the official Codex app, which OpenAI ships
for macOS only, so both stay unavailable here. See platform support.Install the desktop app on Linux
- Run
uname -m.x86_64takes the x64 package;aarch64takes the arm64 package. - Install GTK and WebKitGTK 4.1 from your distribution. The app renders in WebKitGTK, and the installer checks for it.
- Unpack the
.tar.gzand run the installer script inside it. - Accounts, settings, and local history live in
$XDG_CONFIG_HOME/codexuse-desktop, or~/.config/codexuse-desktop. - Other distributions may work, but Ubuntu 24.04 is the one the release is tested on. Check your GTK and WebKitGTK packages first.
Why this is a problem
- The native Codex CLI keeps one active login at a time.
- Linux workflows mix local terminals, SSH sessions, and multiple client contexts in the same day.
- When a rate limit lands, you need a clean way to move to another account without running the whole login loop again.
The fix
CLI-only steps
- Add each account once with a clear name.
- Use device auth when you are on SSH or a headless Linux box.
- Select the account before the next long Codex turn, then start a fresh shell or session.
CodexUse CLI path
- The CodexUse CLI keeps account selection one command away in tmux, SSH, or a remote box.
- It is the same workflow whether you are local or three SSH hops deep.
codexuse profile add Work --login=device
codexuse profile add Personal --login=device
codexuse profile list
codexuse profile switch Work
codexuse run --profile Personal -- "summarize this repository"
Use --login=browser on a normal desktop Linux session if you prefer the browser flow.
Prevent it next time
- Name accounts by role, for example
work,client-acme, orpersonal. - Keep one lower-usage reserve account ready for when the primary account is close to a 429.
- Check headroom with
codexuse profile listbefore big jobs and start them withcodexuse run --profileon the account with the most room, instead of waiting for interruption.
Troubleshooting table
| Symptom | Likely cause | Action |
|---|---|---|
| Selected another account but the next command still feels tied to the old one | The shell or Codex turn started before the selection | Open a fresh shell or start the next session after selecting the account |
| You get a duplicate-account warning | Two account names point at the same OpenAI account | Merge or rename them so the local account list matches reality |
| You are on SSH with no browser access | The auth flow is mismatched to the environment | Use device auth and stay in the CLI path |
What to avoid
- Using the same OpenAI account under multiple account names to fake more capacity.
- Starting a long run before you confirm which account is active.
- Assuming an already-running session will inherit a new account selection mid-turn.
Related
Can I run CodexUse on Linux?
Yes. The desktop app ships for Ubuntu 24.04 on x64 and arm64 and needs GTK with WebKitGTK 4.1. It manages your accounts, custom-model accounts, Account Pool, and headroom. One Codex window per account and Auto-roll need the official Codex app on macOS. On SSH or a headless box, use the CodexUse CLI instead.
Why would I need multiple accounts on Linux?
Linux workflows mix client, work, and personal terminals. Separate accounts keep that work distinct and let you select the right one before a long run or a 429.
Does selecting an account apply to the current session instantly?
Select the account first, then start the next Codex session or open a fresh shell. An already-running turn will not inherit the new active account.