.env
High riskEnvironment Variables File
A file of environment variables loaded at app startup. The `.env` convention is universal in modern development for API keys and DB URLs.
MIME types
- text/plain
Category
data
Aliases
.dotenv
What opens this file
- VS Code
- direnv
- dotenv libraries
How to open by OS
Windows
- VS Code, dotenv-cli.
Mac
- direnv, VS Code.
Linux
- direnv, VS Code.
Ios
- Working Copy.
Android
- Acode.
Safety notes
- Committing
.envto Git leaks credentials. Always add it to.gitignoreand rotate keys immediately on exposure. - In production, move secrets to dedicated stores (Vercel, AWS Secrets Manager, Doppler).
Common mistakes
- Forgetting to quote values with spaces — dotenv parsers truncate at the first whitespace otherwise.
- Putting secrets in public-prefixed variables like
NEXT_PUBLIC_*, which get bundled into the client.