Skip to main content
This tutorial demonstrates how to bulk import environment variables and secrets from a .env file using the Qovery CLI, rather than adding them individually through the web interface.

Prerequisites

Step 1: Install Qovery CLI

The installation command varies by platform:
For additional installation methods, see the CLI documentation.

Step 2: Authenticate and Set Context

Authenticate

This opens your browser for authentication.

Set Context

After authenticating, specify the target application:
Follow the prompts to select:
  1. Your organization
  2. Your project
  3. Your environment
  4. 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

You’ll see an interactive prompt to select which variables to import:
Use:
  • Arrow keys to navigate
  • Space bar to select/deselect
  • Enter to confirm
Select the public variables (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:
When prompted, select “Secrets” instead of “Environment Variables”, then choose the secret variables:
Select the sensitive variables (STRAPI_API_KEY and AUTH0_API_KEY_SECRET) and press Enter.
Secrets are encrypted and cannot be viewed in plain text after import. They can only be updated or deleted.

Step 6: Verify Import

Via Qovery Console

  1. Navigate to your application in Qovery Console
  2. Go to Variables tab
  3. 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

Add .env* to your .gitignore file to prevent accidentally committing secrets:
Maintain separate .env files for each environment:
  • .env.development
  • .env.staging
  • .env.production
Mark these as secrets:
  • API keys
  • Database passwords
  • OAuth client secrets
  • Encryption keys
  • Third-party service tokens
Create a .env.example file with placeholder values:

Troubleshooting

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 #
  • Verify you imported to the correct application
  • Check you ran qovery context set before importing
  • Refresh the Qovery Console page
This is expected behavior. Secrets are encrypted and cannot be viewed in plain text for security reasons.

Environment Variables

Learn about environment variables in Qovery

Qovery CLI

Complete CLI documentation

Secrets Management

Understanding secrets and encryption

Application Configuration

Configure your applications