dokploy icon indicating copy to clipboard operation
dokploy copied to clipboard

Secret Manager integration for external secret providers (Vault, AWS Secrets Manager, etc.)

Open ssatorres opened this issue 9 months ago • 10 comments

What problem will this feature address?

Currently, all environment variables (including sensitive secrets like database passwords, API keys, and tokens) are stored as plain text in Dokploy's database. This creates security concerns for production environments:

  • Secrets are visible to anyone with access to the Dokploy dashboard or database
  • No audit trail of secret access or rotation
  • No centralized secret management across multiple projects
  • Manual secret rotation requires updating each application individually
  • No integration with existing enterprise secret management infrastructure

Many teams already use dedicated secret managers (HashiCorp Vault, AWS Secrets Manager, Doppler, etc.) and currently have no way to leverage them within Dokploy.

Related issues: #2768 #3577

Describe the solution you'd like

A new "Secret Providers" section in Settings (similar to how "S3 Destinations" works today) that allows users to connect external secret managers and reference their secrets in application environment variables.

1. Settings > Secret Providers (centralized management)

A new page in the settings sidebar where admins can:

  • Add and configure secret provider connections (credentials, endpoint, region, etc.)
  • Test the connection before saving (like S3 Destinations does)
  • Manage multiple providers per organization
  • Reuse providers across different projects

Supported providers (MVP):

  • HashiCorp Vault
  • AWS Secrets Manager

Future providers:

  • Google Cloud Secret Manager
  • Azure Key Vault
  • Doppler
  • GitHub Secrets
  • 1Password (Connect Server)

2. Environment tab — referencing secrets

In the application's Environment tab, users would be able to reference external secrets using a syntax like:

# Regular env var (unchanged)
NODE_ENV=production

# Secret from a configured provider
DATABASE_URL={{secret.<providerName>.<secretPath>}}
API_KEY={{secret.<providerName>.<secretPath>#<key>}}

At deploy time, Dokploy resolves these references by fetching the actual values from the configured provider.

Architecture (follows existing S3 Destinations pattern)

Backend:
  packages/server/src/db/schema/secret-provider.ts
  packages/server/src/services/secret-provider.ts
  apps/dokploy/server/api/routers/secret-provider.ts

Frontend:
  pages/dashboard/settings/secret-providers.tsx
  components/dashboard/settings/secret-provider/
    ├── show-secret-providers.tsx
    ├── handle-secret-providers.tsx
    └── constants.ts

UI Mockup

Settings sidebar:

Settings
├── ...
├── S3 Destinations
├── Secret Providers   ← NEW
├── Certificates
├── ...

Secret Providers page (same card layout as S3 Destinations):

┌─────────────────────────────────────────────┐
│  Secret Providers                           │
│  Connect external secret managers           │
│                                             │
│  ┌────────────────────────────────────────┐ │
│  │ 1. Production Vault    Created: ...  ✏️ 🗑│
│  └────────────────────────────────────────┘ │
│  ┌────────────────────────────────────────┐ │
│  │ 2. AWS Staging         Created: ...  ✏️ 🗑│ 
│  └────────────────────────────────────────┘ │
│                                             │
│                      [+ Add Provider]       │
└─────────────────────────────────────────────┘

### Describe alternatives you've considered

 1. **Inject secrets via Docker Secrets / Swarm secrets**: Works only for Docker Swarm
     deployments and doesn't cover standalone Docker or Compose scenarios. Also doesn't
     solve the centralized management problem.

  2. **Use .env files mounted as volumes**: Requires manual file management on the host,
     defeats the purpose of a PaaS, and still stores secrets in plain text on disk.

  3. **Encrypt secrets at rest in Dokploy's database**: Improves storage security but
     doesn't integrate with existing secret management infrastructure and lacks features
     like rotation, audit logs, and access policies.

  4. **External tool like `envchain` or `direnv`**: These are developer-local tools and
     don't apply to server-side deployments managed by Dokploy.

  The proposed solution is superior because it integrates with industry-standard tools that
  teams already use, follows Dokploy's existing architectural patterns (like S3 Destinations),
  and provides a clear upgrade path from plain-text secrets.

### Additional context

  I've studied the codebase and this feature would follow the exact same pattern as
  S3 Destinations:
  - Schema with Drizzle ORM (organization-scoped)
  - Service layer with CRUD + testConnection
  - tRPC router with adminProcedure for management
  - Card-based settings page with Dialog forms

I'm willing to implement this starting with HashiCorp Vault and AWS Secrets Manager as the initial providers, with the architecture designed to easily add more providers later.

### Will you send a PR to implement it?

Yes

ssatorres avatar Feb 27 '26 12:02 ssatorres

Upvoting this issue. Dokploy lacks a mechanism to secure its work with runtime credentials, and the offered mechanism of "secret providers" seems reasonable for that purpose.

What I also would like to note here is Docker Secrets, which are also possible to use here as Dokploy utilizes Docker in Swarm mode. However, those may require more internal changes for the Dokploy and work differently than environment variables (since they're mounted into the container as files), so not sure if those are better or worse.

RobotoLev avatar Feb 27 '26 19:02 RobotoLev

Related: https://github.com/Dokploy/dokploy/issues/1192 (1Password as the secret manager)

peter2meter avatar Apr 06 '26 09:04 peter2meter

+1 for Infisical integration

arikmeyer avatar Apr 19 '26 16:04 arikmeyer

I love this proposal. I'm currently setting up Dokploy with Doppler. In order for it to work, I need to store the Doppler service token in the Dokploy Environment Settings which means it will be stored in plain text. I really like the approach suggested.

nickjamesio avatar Apr 19 '26 22:04 nickjamesio

+1 for Infisical integration

If you're using Infisical specifically, I built Infibridge as a stopgap while native integration gets built into Dokploy. It's a self-hosted webhook bridge. When a secret changes in Infisical, it diffs and syncs to Dokploy automatically. Might be useful until this lands natively.

aboutrax avatar May 27 '26 20:05 aboutrax

+1 for doppler integration

pierrecarcellermeunier avatar Jun 08 '26 15:06 pierrecarcellermeunier

+1 for doppler integration

thesparq avatar Jun 16 '26 11:06 thesparq

Is there any news about this feature? Is someone has started working on it? I would love a support for secret provider inside Dokploy!

benjaminmal avatar Jul 11 '26 13:07 benjaminmal

+1

MrDeik avatar Jul 14 '26 01:07 MrDeik

Coming in the next version 🎉 — #5037 adds third-party secrets manager integration with these providers:

  • HashiCorp Vault (KV v2 — also works with OpenBao, same API)
  • Infisical (cloud or self-hosted)
  • AWS Secrets Manager
  • Doppler
  • Azure Key Vault

You reference secrets directly from any environment variable editor:

DATABASE_URL=${{vault.prod-vault.myapp/creds:DB_URL}}
API_KEY=${{vault.doppler-prod.API_KEY}}

Values are fetched at deploy time and never stored in Dokploy — your vault stays the single source of truth. It also ships with permissions and access control: each provider is explicitly assigned to the projects (and optionally specific environments) where it can be used, references outside that scope fail the deployment before ever contacting the vault, and provider management is covered by role permissions (including enterprise custom roles). The env editors autocomplete provider names and real secret names, scoped to what's allowed where you're typing.

Siumauricio avatar Aug 10 '26 22:08 Siumauricio