Skip to content

Support Desktop using the managed local App Server for direct mobile SSH/Tailscale control #31991

Open

Description

@bamboomoon

Summary

I wanted to control Codex Desktop from the ChatGPT mobile app over my own private network, using Tailscale and SSH, instead of using the hosted Remote Control relay.

The hosted relay is significantly slower in my network environment. Direct SSH over Tailscale has much lower latency, but I still want the native Codex Desktop experience: threads, approvals, plugins, diffs, and project context.

I found a working configuration where Codex Desktop and the ChatGPT mobile SSH client connect to the same managed App Server process.

Working setup

Environment:

  • macOS
  • Codex standalone CLI 0.144.1
  • ChatGPT/Codex Desktop
  • ChatGPT mobile Codex SSH connection
  • Tailscale as the private network
  • Same macOS user and CODEX_HOME

Install the standalone Codex package:

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

Start the managed App Server:

~/.local/bin/codex app-server daemon bootstrap

Enable the existing Desktop local-daemon path:

launchctl setenv CODEX_APP_SERVER_USE_LOCAL_DAEMON 1

After completely restarting ChatGPT/Codex Desktop, the Desktop app connects to:

~/.codex/app-server-control/app-server-control.sock

The ChatGPT mobile SSH connection automatically runs:

~/.local/bin/codex app-server proxy

That proxy connects to the same Unix socket.

Verified process topology

Codex Desktop ───────────────┐
                             ├─ managed codex app-server
ChatGPT mobile → SSH → proxy ┘

The managed server was:

~/.codex/packages/standalone/current/codex app-server --listen unix://

I verified with lsof that:

  • Codex Desktop had one connection to the App Server Unix socket.
  • The mobile SSH proxy had another connection to the same socket.
  • Both connections terminated at the same App Server PID.
  • Messages sent from mobile appeared in the same live Desktop thread.

No public WebSocket port was exposed. Tailscale provided private network reachability, SSH provided authentication and transport, and the App Server remained bound to its user-private Unix socket.

Important installation detail

The Homebrew single-binary Codex installation was not sufficient for this Desktop configuration because it did not include codex-code-mode-host.

The official standalone installation provided both:

~/.codex/packages/standalone/current/bin/codex
~/.codex/packages/standalone/current/bin/codex-code-mode-host

Request

Could this workflow become a supported and documented option?

Ideally, Codex Desktop would provide a setting such as:

Use managed local App Server

This would avoid relying on the undocumented CODEX_APP_SERVER_USE_LOCAL_DAEMON=1 environment variable.

It would let users:

  • Use ChatGPT mobile's native Codex UI.
  • Connect directly through SSH over Tailscale or WireGuard.
  • Avoid the hosted Remote Control relay when direct private connectivity is available.
  • Keep execution, files, credentials, permissions, and project context on the Mac.
  • Preserve the native Codex Desktop experience.
  • Avoid exposing an App Server WebSocket port.

A documented persistent macOS configuration would also be useful because launchctl setenv may not survive logout or reboot.

Related discussions

Activity

  1. added
    enhancementNew feature or request
    appIssues related to the Codex desktop app
    app-serverIssues involving app server protocol or interfaces
    on Jul 10, 2026
  2. eric-gitta-moore commented on Aug 9, 2026

    @eric-gitta-moore

    One additional implementation detail may help when a second computer connects to the Mac through Remote Connections → SSH:

    export CODEX_SSH_SKIP_APP_SERVER_BOOT=true

    In the current ChatGPT Desktop SSH transport, this variable is checked before the SSH client attempts to start its own app-server:

    if [ "${CODEX_SSH_SKIP_APP_SERVER_BOOT:-}" = "true" ]; then
        exit 0
    fi

    After skipping that bootstrap step, the SSH connection still runs:

    codex app-server proxy

    The proxy connects to the existing managed daemon through:

    $CODEX_HOME/app-server-control/app-server-control.sock
    

    This can be useful when a second ChatGPT Desktop instance connects through Settings → Connections → SSH and should attach to an app-server daemon that is already running on the Mac, without starting or replacing a separate SSH-specific app-server.

    The variable must be available in the remote user's interactive login shell. For example, with zsh:

    # ~/.zshrc
    export CODEX_SSH_SKIP_APP_SERVER_BOOT=true

    The managed daemon must already be running before the SSH client connects:

    codex app-server daemon start

    I verified this behavior in ChatGPT Desktop 26.803.41515. This appears to be an undocumented internal variable, so its behavior should be revalidated after Desktop updates.

  3. paysenyu commented on Sep 5, 2026

    @paysenyu

    我也需要这个需求

  4. lincolnqiu commented on Sep 21, 2026

    @lincolnqiu

    maybe use t3code?

  5. ardasevinc commented on Oct 1, 2026

    @ardasevinc

    seconding. i need to main both chatgpt.app and codex cli to leverage app features while still using CLI for long-running threads.

    app has very good features but still loses in system resource usage compared to the CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appapp-serverIssues involving app server protocol or interfacesenhancementNew feature or requestremote

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions