.env.dist.local [hot]
: New developers can copy .env.dist.local to .env.local to get a pre-configured local setup that already has the correct ports or service URLs for a standard local dev kit (like Docker).
APP_ENV=dev APP_DEBUG=true APP_SECRET=ChangeMeForLocalDev
This ensures that APP_DEBUG=true from .env.dist.local never leaks into your test suite.
: A file containing machine-specific overrides that should never be committed to a shared repository. .env.dist.local
Consider a typical Symfony or Laravel application. When the application boots, it loads environment variables in this order (lowest to highest precedence):
If you want to integrate this pattern into your current setup, let me know:
This approach solves several critical problems: : New developers can copy
"scripts": "setup-env": "cp -n .env.dist .env && cp -n .env.dist.local .env.local" Use code with caution.
Implementing this file in your repository yields three major benefits for engineering teams. 1. Documenting Local-Only Toggles
In frontend applications, environment variables prefixed with certain patterns (like NEXT_PUBLIC_ in Next.js or VITE_ in Vite) get bundled into client-side JavaScript. Never put sensitive information in these variables—anyone who can view your application's source can extract these values. Consider a typical Symfony or Laravel application
Whenever you add a new feature toggle or local configuration variable to the project infrastructure, immediately add its placeholder to .env.dist.local .
In the modern world of software development—spanning PHP (Laravel, Symfony), Node.js, Python (Django), and beyond—environment configuration files are the unsung heroes of deployment and collaboration.
When using the pattern where .env files are committed, conflicts can arise if team members commit different default values. This is why the pattern of committing only distribution files and ignoring local overrides is preferred—it eliminates these conflicts entirely.
Thus, is a version-controlled distribution file that contains the recommended local development environment variables , including both required keys and sensible defaults for local development.