Set environment variables
You can configure up to 50 environment variables per Pod. During Pod creation:- Click Edit Template and expand Environment Variables.
- Click Add Environment Variable and enter the key-value pair.
- Navigate to My Templates.
- Create or edit a template and add variables in the Environment Variables section.
Update environment variables
- Go to Pods and click the three dots next to your Pod.
- Select Edit Pod and expand Environment Variables.
- Add or update variables and click Save.
Access environment variables
In your Pod’s terminal:- Python
- JavaScript
- Bash
Runpod-provided variables
Runpod automatically sets these environment variables:Best practices
- Use secrets for sensitive data: Never hardcode API keys or passwords. Use Runpod secrets.
- Validate required variables: Check that critical variables are set before your application starts.
- Provide defaults: Use fallback values for non-critical configuration.
- Use descriptive names: Prefer
DATABASE_PASSWORDoverDB_PASS. - Group related variables: Use consistent prefixes like
DB_HOST,DB_PORT,DB_NAME.