.env.development Jun 2026
By convention, keys are always written in UPPER_CASE_SNAKE_CASE .
# .env.development VITE_API_URL="http://localhost:5000/api" DB_PASSWORD="super_secret_local_password" # Only available in vite.config.js Use code with caution.
If multiple .env files exist, the framework loads them based on a strict hierarchy. File Cascading and Priority .env.development
: Keep your production credentials safe by using separate files like .env.production .
# The environment name (usually 'development' for this file) NODE_ENV=development # Port number for the local development server # Full URL for the local frontend APP_URL=http://localhost:3000 # --- API & BACKEND --- # Local backend API URL (standard for general use) API_BASE_URL=http://localhost:8080/api/v1 # Prefix for React (Required for Create React App) REACT_APP_API_URL=http://localhost:8080/api/v1 # Prefix for Vite VITE_API_URL=http://localhost:8080/api/v1 # Prefix for Next.js (Exposed to the browser) NEXT_PUBLIC_API_URL=http://localhost:8080/api/v1 # --- DATABASE (LOCAL DEV ONLY) --- # Connection details for your local database instance File Cascading and Priority : Keep your production
A common point of confusion is whether .env.development should be committed to version control (Git).
Local overrides across all environments (except sometimes testing). Never committed to git. Never committed to git
By adopting these recommendations, developers can improve their development workflow, reduce errors, and enhance the security of their applications.
: High priority. Houses shareable development configs.
Your editor doesn't know which schema to validate against.
: The global fallback file. Contains defaults used when no specialized environment rules match the current runtime state. Syntax Best Practices