Article

Use Copilot CLI on GHES without GitHub Cloud

For teams running self-hosted GitHub, learn the model, server and developer setup needed for disconnected Copilot CLI, plus remaining costs.

Editorial illustration for Use Copilot CLI on GHES without GitHub Cloud: code brackets represent developer tools. Not documentary evidence.

Teams running GitHub Enterprise Server (GHES), GitHub hosted by their own organization, can use Copilot CLI’s terminal-based coding assistance without GitHub Cloud or a Copilot subscription. GitHub documents this as generally available from GHES 3.22.3, a server patch released on November 3, 2026.

Enterprise licensing and model-running costs remain. For full isolation, the model endpoint must stay inside the isolated network; switching on offline mode does not bring an internet-hosted model on premises.

The version threshold is not a recommendation to install an old patch: the 3.22 release notes list 3.22.5, released November 17. Choose an appropriate supported stable release. This workflow does not require the 3.23 release candidate; GitHub reserves release candidates for test and staging environments.

Decide what must stay offline

First distinguish two requirements. If only GitHub Cloud is off limits, an approved external model provider may fit your network policy. If prompts and code must never leave the isolated environment, the model service must be internal too. GitHub’s offline-mode documentation makes this distinction explicit.

Do not substitute the cloud administration workflow. Enterprise custom models configured through GitHub’s cloud settings still use GitHub’s Copilot API and require internet access and a Copilot licence. The GHES configuration below is a different route.

If cloud sign-in is acceptable and you want a graphical client, the Copilot desktop app’s GHES setup answers that separate question. Its onboarding starts with a cloud account; it is not this disconnected terminal workflow.

Prepare a compatible model and the client packages

GitHub’s model requirements call for tool calling, which lets the model request actions, and streaming, which delivers responses progressively. A model that can answer a chat prompt is not necessarily suitable for agent tasks.

The provider types are openai, azure and anthropic. Here, openai can mean a compatible internal service such as Ollama or vLLM, not necessarily OpenAI’s cloud. Check the model’s actual context capacity: an unknown model may receive a default allowance of 128,000 prompt tokens that exceeds what it supports. A larger configured limit does not enlarge the model.

Keep model hosting separate from the GitHub appliance. GitHub does not support adding third-party software to the appliance’s underlying operating system. For this server-routed design, the practical planning requirement is an endpoint reachable from the server, not merely a model running on one developer’s laptop.

Prepare both copilot and gh on developer machines through your approved software-distribution process. GitHub offers package-manager installation and downloadable Copilot executables; the npm route requires Node.js 22 or later. Stage packages and project dependencies through the permitted internal route—an internet download command is not an offline installer.

GitHub’s GHES setup page names no minimum CLI build; confirm compatibility in your pilot.

Administrator: configure the server’s provider

Inspect and preserve existing settings, then follow GitHub’s GHES configuration procedure with administrative SSH access and ghe-config. Required fields:

  • app.copilot-proxy.enabled — set to true.

  • app.copilot-proxy.endpoint-url — full model-service base URL, including its API-version prefix.

  • secrets.copilot-proxy.endpoint-key — upstream credential, supplied through approved secret handling.

  • app.copilot-proxy.provider-model-id — chosen model identifier.

  • app.copilot-proxy.provider-type — openai, azure or anthropic.

Apply the reviewed configuration with ghe-config-apply. The GHES instructions require an upstream key; do not assume a keyless endpoint accepts an empty or dummy value.

Developer: authenticate to the right server

Use host-specific GitHub CLI authentication: gh auth login --hostname followed by your GHES hostname. Omitting the host defaults to github.com. Check credential storage: gh normally uses the system credential store but can fall back to a plaintext file.

Before launching copilot, supply the three GHES client settings:

  • COPILOT_PROVIDER_GHES_HOST — server hostname.

  • COPILOT_PROVIDER_GHES_TOKEN — user’s server credential, not the provider key.

  • COPILOT_OFFLINE — true.

The server token remains required for inference. Follow the linked credential procedure through your organization’s approved secret-management process.

Keep gh pointed at the same server. GitHub CLI’s environment reference says GH_HOST supplies the host when command or repository context does not. For server authentication, GH_ENTERPRISE_TOKEN precedes GITHUB_ENTERPRISE_TOKEN; environment credentials override a stored login. Check which identity will be used without displaying its token.

Check which features your workflow needs

GitHub’s offline feature matrix supports coding, shell/file work and GHES issues, pull requests and repositories through authenticated gh. It excludes GitHub MCP tools, web search/fetch, GitHub-hosted model selection, telemetry/usage reporting and automatic updates.

Cloud-agent delegation is also not an offline substitute: /delegate requires GitHub-hosted services. The GitHub MCP limitation should not be read as a blanket verdict on every custom local tool.

Treat network isolation as a separate operational check. gh has its own telemetry and update controls: GH_TELEMETRY=false disables its telemetry, while GH_NO_UPDATE_NOTIFIER and GH_NO_EXTENSION_UPDATE_NOTIFIER disable their respective update notifications.

The practical implication is that COPILOT_OFFLINE is not a workstation firewall. Review the destinations used by shell commands, extensions and project tools, and enforce the intended boundary independently. Disabled Copilot telemetry is not evidence that local or provider logs do not exist.

Budget for the model and ongoing maintenance

No Copilot subscription does not mean a free enterprise deployment. GHES still requires an Enterprise licence file. Keep the existing licensing arrangement in the budget; disconnected operation does not establish that every initial licensing or provisioning step can happen without external access.

For an already licensed team, compare the additional costs in three buckets: model capacity, operating staff time and software maintenance. An external provider may charge for usage; an internal model needs computing resources and an owner. The right comparison depends on your chosen model, workload and hosting arrangement, not a universal per-developer saving.

If your organization can use Microsoft cloud services instead, Copilot CLI access through Microsoft 365 is another eligibility and billing route. It does not meet the requirement to keep inference entirely inside an isolated network.

Pilot a small task before wider rollout

A useful first pilot is to ask Copilot to explain an approved local file, then inspect a permitted GHES repository using gh. If you allow an edit, review the diff and run the project’s relevant checks. Have the network owner separately confirm that traffic stays within the intended boundary.

Expand only when the chosen model handles the team’s task, repository operations use the intended identity, and someone owns model capacity and internal client updates. Protocol compatibility establishes a connection; it does not establish coding quality or readiness for your workload.