dotenv vs Doppler side by side
| dotenv | Doppler | |
|---|---|---|
| Type | open-source library | hosted secrets manager (SaaS) |
| Cost | free | free tier, paid team plans (check current pricing) |
| Setup | minutes | an hour or so for the first project |
| Where secrets live | files on each machine | Doppler's encrypted store |
| Access control | file system permissions | per user, project and environment |
| Audit log | no | yes |
| CI/CD and host sync | manual copy | integrations |
| Works offline | yes | with a cached fallback file |
| Self-hosting | n/a | no |
What changes in your workflow
# dotenv: each developer has a .env, the app loads it node server.js # with import "dotenv/config" # Doppler: secrets come from the CLI, no file on disk doppler login doppler setup # choose project + config (dev, stg, prd) doppler run -- node server.js # process.env is filled before start
Because both end in process.env, application code stays identical. Validation and types are a separate layer either way, see dotenv vs config libraries.
When dotenv is enough
- Solo projects or two people who share secrets through a password manager.
- Open-source projects whose
.envonly holds local development values. - One deployment target whose dashboard is the production source of truth.
Keep it safe with the basics: .env best practices, a committed .env.example, and encrypted sharing with the ENV encrypt tool instead of plain text in chat.
When to move to a secrets manager
- Three or more engineers need production or staging secrets.
- An auditor asks who accessed which secret and when.
- Several platforms (Vercel, a worker host, GitHub Actions) must receive the same values.
- A secret has leaked before, or offboarding someone means rotating everything by hand.
- Onboarding includes "ask someone to send you the .env".
Alternatives to Doppler
| Tool | Model | Fits when |
|---|---|---|
| Infisical | open source, self-hostable or cloud | you want data sovereignty or no vendor lock-in |
| HashiCorp Vault / OpenBao | self-hosted, very flexible | a platform team can run it; dynamic database credentials |
| AWS Secrets Manager / Parameter Store | cloud-native | you are mostly on AWS |
| Google Secret Manager / Azure Key Vault | cloud-native | you are on GCP / Azure |
| 1Password Secrets Automation | password-manager based | the team already uses 1Password |
A broader comparison: HashiCorp Vault alternatives and dotenv vs secrets managers.
Migrating from dotenv to Doppler
- Clean the file first: remove duplicates with the ENV cleaner and check for leaked keys with the ENV leak checker.
- Create a project and upload:
doppler secrets upload .env(once per config: dev, stg, prd). - Replace start commands with
doppler run -- …locally and in scripts. - Connect the integrations for your hosts and CI so values sync automatically.
- Delete the local
.envfiles and rotate anything that was ever shared in plain text.
Frequently asked questions
Do I have to change my code to use Doppler?
No. doppler run -- <command> injects secrets as environment variables, so code that reads process.env.DATABASE_URL keeps working unchanged.
What if Doppler is down when my app starts?
doppler run can use a local encrypted fallback file with the last known secrets. For production, many teams sync secrets into the platform's own environment settings so startup doesn't depend on Doppler at all.
Is switching back possible?
Yes. doppler secrets download --no-file --format env > .env exports everything as a regular .env file.
Is Doppler better than a password manager for secrets?
For application secrets, yes: it injects values into processes and CI and keeps per-environment configs. A password manager is fine for small teams sharing a few values by hand.
Do I still need .env.example with Doppler?
It's still useful as documentation of which keys exist, especially for open-source contributors who won't have Doppler access.