Configure application behavior using environment variables on RepoCloud
Environment variables are a powerful way to configure your applications without modifying code. They allow you to customize your application’s behavior, store configuration settings, and manage sensitive information like API keys and database credentials.
Environment variables are dynamic values that can affect the way running processes behave on a computer. In the context of containerized applications, they provide a way to:
RepoCloud makes it easy to set, update, and manage environment variables for your applications through a simple web interface.
Navigate to Instance Management
Go to your application’s management page in the RepoCloud dashboard
Open Environment Variables
Click on the “Environment Variables” tab
View Current Variables
You’ll see a list of all currently configured environment variables
Navigate to Environment Variables
Access the Environment Variables section as described above
Add New Variable
Click the “Add Variable” button
Enter Key and Value
Enter the variable name (key) and its value
Example:
DATABASE_URL
mysql://user:password@localhost:3306/mydatabase
Save Changes
Click “Save” or “Apply Changes” to update your application’s environment
Restart Application
In most cases, your application will automatically restart to apply the new variables
Navigate to Environment Variables
Access the Environment Variables section
Edit a Variable
Click the edit icon next to the variable you want to modify, then update its value
Delete a Variable
Click the delete icon next to the variable you want to remove
Save Changes
Click “Save” or “Apply Changes” to update your application’s environment
Changes to environment variables typically require an application restart to take effect. RepoCloud automatically handles this for most applications.
Environment variables are commonly used to store sensitive information like API keys, passwords, and tokens. RepoCloud implements security measures to protect this data:
••••••••
)Despite these precautions, you should never store extremely sensitive secrets (like private keys) as environment variables. For such cases, consider using a dedicated secrets management solution.
Different applications use different environment variables, but some common categories include:
Database Connection Strings
Variables that define how your application connects to a database:
API Keys and Authentication
Variables for third-party service integration:
Application Settings
Variables that control application behavior:
Email Configuration
Variables for email service configuration:
Each application has its own set of supported environment variables. Here are examples for some popular applications:
WordPress
Common WordPress configuration variables:
Node.js Applications
Common Node.js application variables:
PostgreSQL
PostgreSQL configuration variables:
Check your application’s documentation to understand which environment variables are available and what they do. Many applications include a list of supported variables in their documentation.
Follow these best practices when working with environment variables:
Application Not Recognizing Variables
If your application doesn’t recognize environment variables:
Syntax Errors
Some common syntax issues:
KEY=value
, not KEY = value
)Changes Not Taking Effect
If changes don’t seem to apply:
Learn how to scale your application resources
Keep your application updated with the latest features and security patches
Resolve common issues with your RepoCloud applications