Skip to content

Document DOCKER_HOST requirement for SDKs on Docker Desktop for Linux #23308

@varsnotwars

Description

@varsnotwars

Is this a docs issue?

  • My issue is about the documentation content or website

Type of issue

Information is incorrect

Description

Problem

The official Linux install docs now recommend Docker Desktop. After a fresh Desktop install on Linux, the docker CLI works (desktop-linux context), but SDKs and tools that expect /var/run/docker.sock (or an unset DOCKER_HOST) fail with:

Cannot connect to the Docker daemon at unix:///var/run/docker.sock.

Desktop for Linux doesn’t bind /var/run/docker.sock by default; it uses a per-user socket (desktop-linux context). The default context is just the CLI’s legacy placeholder. This is not an issue on macOS or Windows Desktop. Prior user confusion: docker/for-linux#1376.

Reproduction

  1. Install Docker Desktop for Linux from official docs.
  2. docker run hello-world works.
  3. Run Go or Python SDK code (default config) → cannot connect.
  4. export DOCKER_HOST=$(docker context inspect desktop-linux --format '{{ .Endpoints.docker.Host }}') fixes the SDK.

Impact

SDKs and tools fail until users manually export DOCKER_HOST; current docs don’t mention this.

Location

https://docs.docker.com/desktop/

Suggestion

Add a Linux note in:

  • Desktop > Install > Linux (post-install / next steps)
  • Desktop > Troubleshoot > Known issues

Snippet:

export DOCKER_HOST=$(docker context inspect desktop-linux --format '{{ .Endpoints.docker.Host }}')

Explanation:
"Docker Desktop for Linux does not bind /var/run/docker.sock by default. It uses a per-user socket (desktop-linux context); SDKs and tools need DOCKER_HOST exported."

Optionally note adding the export to the user’s shell profile and link from language SDK docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/apiRelates to Docker API docsarea/desktopIssue affects a desktop edition of Docker. E.g docker for macarea/engineIssue affects Docker engine/daemon

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions