Skip to content

SSH keys not working for private repo builds (SSH_AUTH_SOCK empty) #2913

Description

@uptoamir

What problem will this feature address?

When deploying a Docker Compose app that builds from a private GitHub repo (e.g. git@github.com:uptoamir/******#develop), the build fails with:

invalid empty ssh agent socket: make sure SSH_AUTH_SOCK is set

Dokploy’s SSH keys (added under Core → SSH Keys) are not forwarded to BuildKit during the build.

Expected:
Dokploy should automatically forward configured SSH keys to Docker builds so private repos can be cloned without manual tokens or workarounds.

Workaround:
Use HTTPS + GITHUB_TOKEN or push a prebuilt Docker image.

Environment:
Self-hosted Dokploy (Hetzner VPS, Ubuntu 22.04)

Describe the solution you'd like

Support Docker-compose within private repo dependencies.

Describe alternatives you've considered

Using an HTTPS build context with a GitHub personal access token (GITHUB_TOKEN) — works, but less secure and not ideal for CI/CD.
•	Manually building the Docker image locally or in CI, then pushing it to Docker Hub — functional but adds extra steps and breaks Dokploy’s one-click deployment flow.
•	Switching to Coolify, which supports private repo cloning via OAuth and SSH agent forwarding automatically.

These workarounds confirm the issue is specific to Dokploy’s lack of SSH agent forwarding during builds.

Additional context

No response

Will you send a PR to implement it?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions