.env file using the Qovery CLI, rather than adding them individually through the web interface.
Prerequisites
- A compliant dotenv (
.env) file following RFC 2-dotenv specifications - An existing application created in Qovery
Step 1: Install Qovery CLI
The installation command varies by platform:- Linux/Unix
- macOS
- Windows
Step 2: Authenticate and Set Context
Authenticate
Set Context
After authenticating, specify the target application:- Your organization
- Your project
- Your environment
- Your application
Step 3: Prepare Your .env File
Create a.env file with your variables. For example, .env.development:
Step 4: Import Environment Variables
Import Public Variables
- Arrow keys to navigate
- Space bar to select/deselect
- Enter to confirm
COLOR_BACKGROUND and API_URL) and press Enter.
Public environment variables are visible in the Qovery Console and can be viewed by team members.
Step 5: Import Secrets
For sensitive data, import as secrets:STRAPI_API_KEY and AUTH0_API_KEY_SECRET) and press Enter.
Step 6: Verify Import
Via Qovery Console
- Navigate to your application in Qovery Console
- Go to Variables tab
- Verify both environment variables and secrets are present
Via CLI
Advanced Usage
Import from Different Files
Override Existing Variables
Use the--force flag to override existing variables:
Import Specific Variables
You can also manually specify which variables to import by editing your.env file before importing.
Best Practices
Never commit .env files to Git
Never commit .env files to Git
Add
.env* to your .gitignore file to prevent accidentally committing secrets:Use different files for different environments
Use different files for different environments
Maintain separate
.env files for each environment:.env.development.env.staging.env.production
Always use secrets for sensitive data
Always use secrets for sensitive data
Mark these as secrets:
- API keys
- Database passwords
- OAuth client secrets
- Encryption keys
- Third-party service tokens
Document your environment variables
Document your environment variables
Create a
.env.example file with placeholder values:Troubleshooting
Import failed: invalid format
Import failed: invalid format
Ensure your
.env file follows the RFC 2-dotenv specifications:- One variable per line
- Format:
KEY=value - No spaces around the
=sign - Comments start with
#
Variables not appearing in console
Variables not appearing in console
- Verify you imported to the correct application
- Check you ran
qovery context setbefore importing - Refresh the Qovery Console page
Cannot see secret values
Cannot see secret values
This is expected behavior. Secrets are encrypted and cannot be viewed in plain text for security reasons.