.env.default.local

In production or CI, you don't use files. You use native environment variables set by your hosting provider (AWS Lambda, Heroku, K8s secrets) or your CI runner. These override everything else.

Your team uses a feature flag service (LaunchDarkly, Flagsmith). In production, flags are remote. But during local development, you want certain flags to be "on" by default. .env.default.local

Put this in .env.default: FEATURE_NEW_DASHBOARD=false In production or CI, you don't use files

Put this in your local (gitignored) .env.default.local: FEATURE_NEW_DASHBOARD=true | Goal | Better naming | |------|----------------| |

Now you develop the new dashboard WITHOUT waiting for a remote toggle. When you commit code, you don't accidentally commit the "on" flag, forcing it on for everyone.

Even though .env.default.local is not committed, never store real production credentials there. A local file on a laptop can be stolen, backed up, or exposed. Use a secrets manager (Vault, AWS Secrets Manager, 1Password CLI) for sensitive values.


| Goal | Better naming | |------|----------------| | Template file | .env.example | | Local dev defaults (safe to commit) | .env.defaults | | Local overrides (gitignored) | .env.local | | Both template + local | .env.example + .env.local |

HomeCategories