.env.dist.local 💯
Sometimes an application requires local tools that aren't used in production (e.g., a local MailHog instance or a specific Docker port). By putting these in .env.dist.local , you tell your teammates: "If you are running this locally, you will likely need to configure these specific variables." 2. Standardizing Developer Workflows
If you want to introduce this file into your automated project setup (e.g., in a Node.js, Python, or PHP project), you can use a initialization script. Here is an example of a shell script ( setup.sh ) that leverages .env.dist.local : .env.dist.local
: .env.dist typically holds production-relevant defaults or CI defaults. .env.dist.local is specifically for developer workstation settings — things like APP_DEBUG=true , MAILER_DSN=smtp://localhost:1025 , or XDEBUG_MODE=debug . Sometimes an application requires local tools that aren't
: Since this file is committed to Git, any API keys or passwords placed here will be exposed to anyone with access to the repository. Use the official Symfony Documentation to learn more about secret management. Here is an example of a shell script ( setup
Like any .dist file, this is tracked by Git. It should only contain keys and "safe" default values (e.g., DB_USER=root ).
To ensure you don't accidentally leak infrastructure settings or individual configurations to your public repository, ensure your .gitignore file explicitly blocks local environment variants: