How to Configure Environment Variables
Use environment variables to configure Profinity for flexible deployments across different environments.
Prerequisites
- Profinity V2 installed
- Access to system configuration files
- Understanding of environment variable syntax
Steps
Step 1: Understand Environment Variable Usage
Environment variables allow you to: - Change configuration without editing files - Use different settings for different environments - Deploy the same configuration across multiple systems
Step 2: Set Environment Variables
Windows: 1. Open System Properties → Environment Variables 2. Add new variables or edit existing ones 3. Click OK to save 4. Restart Profinity for changes to take effect
Linux/macOS:
1. Edit your shell profile (.bashrc, .zshrc, etc.)
2. Add: export VARIABLE_NAME=value
3. Or set in systemd service file (for services)
4. Restart Profinity
Docker:
1. Set in docker-compose.yml:
.env file
3. Restart containers
Step 3: Reference Variables in Config Files
In your Config.yaml or Profile.yaml files:
http:
port: ${HTTP_PORT:-18080} # Use HTTP_PORT or default to 18080
address: ${HTTP_ADDRESS:-0.0.0.0}
logging:
level: ${LOG_LEVEL:-Info}
Step 4: Use Variables in Docker Compose
Create a .env file:
Reference in docker-compose.yml:
Step 5: Verify Configuration
- Check environment variables are set correctly
- Restart Profinity
- Verify settings are applied
- Check logs for configuration details
Common Environment Variables
HTTP_PORT- HTTP server port (default: 18080)HTTPS_PORT- HTTPS server port (default: 18443)LOG_LEVEL- Logging level (Info, Debug, Warning, Error)PROFILE_NAME- Default profile nameCONFIG_NAME- Configuration nameENABLE_SCRIPTING- Enable scripting (true/false)
Related Documentation
- Environment Variables - Complete environment variable reference
- Docker Installation - Docker environment setup