Manage Environment Variables
Add New Variable
Environment Variables
No Variables Added
Add variables or select a template to get started
Common Questions
What is a .env file?
.env files are simple text files that store environment variables for your application. Each line in a .env file follows the format KEY=VALUE. These files are commonly used to store configuration settings and sensitive information like API keys or database credentials.
Why should I use a .env file?
Using .env files helps separate configuration from code, making your application more portable and secure. It follows the principles of the 12-factor app methodology and allows you to have different configurations for different environments (development, staging, production) without changing the code.
How are .env files different from other configuration methods?
.env files are simple and widely supported across many frameworks and platforms. Unlike hardcoded values or configuration files that might be committed to version control, .env files are typically excluded from repositories for security reasons, with developers maintaining their own local copies.
What types of values should be stored in .env files?
Environment variables are ideal for configuration that varies between environments, such as API endpoints, database connection strings, feature flags, API keys, secrets, credentials, and application modes (development/production). Any value that might change between environments or contains sensitive information is a good candidate.
Are .env files secure?
.env files themselves aren't encrypted, so their security depends on proper handling. Best practices include: never committing them to version control, using a .env.example template with dummy values, restricting file permissions, and using different files for different environments. For highly sensitive production environments, consider using dedicated secret management services.
How do I use .env files in different frameworks?
Most modern frameworks support .env files natively or through libraries. In Node.js, you can use the dotenv package. React applications use REACT_APP_ prefixed variables. Next.js, Laravel, Django, and other frameworks have built-in support. Always check your framework's documentation for specific guidelines.