Learning resourcesReviewed · OpenAI

Run Codex with an NFS home directory

This guide helps Linux users and administrators share a Codex home over NFS, but database migration requires stopping Codex on every host and verifying cross-host file locks. It covers SQLite journal conversion, daemon settings, diagnostic logs, batch-job isolation and recovery after migration failures.

Researched 15 Nov 2026

In short.

This guide shows Linux users and administrators how to keep a Codex home directory (~/.codex by default, used by the Codex app and CLI) on NFS storage shared between hosts while addressing SQLite database corruption risks. Safe migration requires stopping Codex on every host and confirming that file locks work across hosts. It describes converting SQLite databases from write-ahead logging to DELETE rollback journals, controlling background daemons and keeping batch-job databases local. Its central warning is that any client writing during migration can corrupt the database and lose changes to goals or memories, and that rollout files cannot restore all database state. The page provides operational instructions and expected output messages; migration reliability, performance and recovery outcomes remain untested.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage includes the complete page at [https://learn.chatgpt.com/docs/environments/network-file-systems.md]: migration prerequisites, the stop-all-clients warning, migration and resume steps, optional local diagnostic logging, fleet journal-mode enforcement, both batch-job strategies and all three troubleshooting FAQs. Linked documentation, the documentation index and the linked release page are excluded. No commands were executed; locking, migration, daemon behavior, conversation continuity, permissions, performance and recovery were not independently verified.

The overview

identity

Run Codex with an NFS home directory is a documentation guide at [https://learn.chatgpt.com/docs/environments/network-file-systems.md]. It addresses Linux hosts sharing the Codex home directory, normally ~/.codex, through Network File System storage. Its scope includes interactive CLI use, the Codex app over SSH, fleet configuration and independent batch jobs.

assessment

The guide is useful when shared Codex history must remain accessible across Linux machines. It explains the storage failure mechanism, gives an ordered migration procedure and describes what to preserve after failure.

Its practical value depends on control over all clients using the shared home and access to someone who can verify NFS locking. If either condition cannot be met, the page's local-database options deserve attention before attempting shared interactive storage.

users

The main audiences are developers moving Codex conversations between Linux hosts, users connecting to an SSH backend, storage administrators and administrators managing multiple Codex users. Batch-job operators also get guidance on preserving conversation records or retaining only results.

The steps involve terminal commands, filesystem paths, configuration files and storage locks. Beginners will benefit from Linux administration support, particularly when checking a shared mount or recovering a database.

capabilities

The page explains how to migrate an existing shared home, resume a conversation afterward, move diagnostic logs to local disk and separate batch-job databases from interactive history. Its troubleshooting covers lock errors, missing databases, insufficient staging space, skipped log databases and failed migrations.

For fleets, it documents unsafe_enforce_sqlite_journal_mode = true in /etc/codex/requirements.toml. This setting affects every user on configured hosts and triggers migration when affected databases open for writing on NFS. All clients must first stop, and migration for each shared home must finish on one host before other hosts reconnect.

Using it

requirements

Every participating host, including an SSH backend, needs a Codex build containing codex migrate-nfs-db. The page names Codex CLI 0.166.0 as an example. Users must confirm that all hosts sharing the home resolve to the same SQLite directory.

A storage administrator should verify that a lock held on one host blocks a conflicting lock on another. The guide advises keeping SQLite local if the mount cannot provide this behavior. Migration requires sufficient local staging space, the home owner's account and usual configuration. SQLite-home and log-directory settings must remain unchanged during migration.

mechanism

Codex uses SQLite databases for its conversation index, goals and memory-processing state. On local disk it normally uses write-ahead logging, or WAL. Processes on different hosts cannot share the memory WAL requires, creating a corruption risk when they write through a shared NFS home.

When Codex detects Linux NFS, it creates databases using DELETE rollback-journal mode, which relies on file locks. Existing WAL databases need migration before another host opens them. Conversation events remain in separate rollout-*.jsonl files; the guide says these can already live on NFS because each rollout has one writer at a time.

setup

Check codex --version on every host and confirm storage locations and locking. End active turns and stop all applications, CLI sessions, remote servers, background daemons and scheduled jobs using the shared home. Keep them stopped until migration completes.

Stop each running daemon with codex app-server daemon stop. The guide recommends setting daemon_auto_start = false under [features] in the shared config.toml. For individual sessions, --no-daemon bypasses a daemon, including one already running; stopping existing writers remains necessary.

Run codex migrate-nfs-db on one Linux host as the home owner. After success, inspect any Skipped logs database message: a local logs database needs no further action, while one on NFS must use DELETE mode or move locally. Resume a familiar conversation from another host as the same user and check the last turn and continued conversation.

example

The page's batch-job example sets CODEX_HOME to /mnt/nfs/codex/jobs/job-1234 and CODEX_SQLITE_HOME to /var/local/codex/jobs/job-1234, then calls codex exec to summarize a repository's build steps. The shared directory preserves the job's rollout, while the worker-local directory keeps its database separate from other workers.

The scheduler must create both directories and provision authentication and configuration. A managed or configured sqlite_home takes precedence over CODEX_SQLITE_HOME. This is a documented configuration example; no execution result is available.

Assessment & evidence

limitations

A concurrent writer during conversion can corrupt the database and lose changes to goals or memories. Rollout files cannot restore all database state; recovery of SQLite-only state requires an intact database.

The daemon's Unix socket works only on the host that started it. Existing log_dir settings can cause migration to skip the logs database. Managed sqlite_home settings can also keep that database in a required location even after log_dir changes. Group permissions and extended access rules require verification after migration.

The recovery command on the page puts backtick-quoted text inside a double-quoted prompt argument. In bash and POSIX shells, those backticks trigger command substitution: the shell tries to run $ codex doctor and _wal_migration_backup instead of passing those strings literally to Codex. These attempts are likely to fail with command not found, leaving the intended doctor step and backup-name hint out of the prompt. Fix the quoting, for example by using single quotes around the prompt or removing the backticks, before running it. This follows from reading the command; it was not run.

The described NFS detection and migration behavior concerns Linux. Compatibility with other platforms, particular storage appliances and specific mount configurations is not established.

reasoning

The guide's recommendations follow from the different roles of conversation files and databases. Keeping rollout files on shared storage preserves a conversation record, while database placement determines which processes contend for indexed state.

The practical decision is whether a job needs shared interactive history, its own resumable record or only a final result. Shared interactive use requires coordinated migration and working cross-host locks. Independent jobs can use private local databases and separate indexes, reducing contention for the interactive database.

alternatives

The page presents several storage choices: keep SQLite local when cross-host locking is unsuitable; place an independent job's entire Codex home on local disk; or combine a private durable home for rollouts with a private host-local SQLite directory. A worker's separate index does not become the interactive index.

For jobs needing only a result, codex exec --ephemeral skips saving a resumable session. The guide suggests -o for a durable final-response file or --json for streamed events. Optional host-local diagnostic logging can reduce NFS traffic; older logs remain in their existing location.

evidence

The complete documentation page at [https://learn.chatgpt.com/docs/environments/network-file-systems.md] supplies the procedural evidence. It includes configuration examples, failure explanations and expected messages such as Migrated database:, WAL backup: and Already in DELETE mode:.

It contains no execution transcript, measured performance results or mount-specific validation. No commands were executed for this report. Successful migration, conversation continuity, permission preservation and recovery outcomes remain unverified.

Access & freshness

costs

The page supplies no pricing. Codex access charges, job usage charges, storage costs and total administrative cost are unknown. Operational requirements include stopping shared-home clients and providing sufficient local staging space, but migration duration and required storage quantities are unspecified.

rights

The page contains no explicit license or redistribution terms for its documentation, examples or the underlying Codex software. Reuse and redistribution rights cannot be established from this evidence. The linked repository and other linked pages are outside the covered material.

freshness

The page was captured on 15 November 2026 at 02:29:03.823 UTC. No publication or last-update date is supplied. Codex CLI 0.166.0 is an example release containing the migration command; the page does not establish the earliest compatible release or the latest available version. Command availability must be checked on each host.

actions

Before migration, identify every host and writer using the shared home, confirm effective SQLite locations and verify cross-host locking. After migration, inspect database and backup messages, resolve skipped NFS log databases, verify relevant permissions and check conversation continuity from another host.

If migration fails, keep other clients stopped and preserve the exact error, database path and printed backup path. Keep the original database and its sidecar files together in the backup directory. After fixing a lock or space error, retry on the same host. For integrity errors or missing replacements, work from copies before restoring anything.

Before starting a separate recovery session, confirm that managed settings will not redirect writes into the affected home. The guide recommends a temporary local home for that session and notes that sign-in may be required. Correct the recovery example's prompt quoting before use: backticks inside its double-quoted argument cause the shell to try to execute the enclosed text, likely removing the doctor step and backup-name hint from the prompt. Use single quotes around the prompt or remove the backticks. This warning comes from reading the command; it was not run.

Evidence for this report

selected-page.txtselected · checked 2026-11-15