Environment variables are key-value pairs accessible within your container. Use them to pass configuration settings, secrets, and runtime information without hardcoding values into your code or container image.Documentation Index
Fetch the complete documentation index at: https://runpod-b18f5ded-promptless-remove-flash-beta-notification.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
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:| Variable | Description |
|---|---|
RUNPOD_POD_ID | Unique Pod identifier. |
RUNPOD_DC_ID | Data center identifier. |
RUNPOD_POD_HOSTNAME | Server hostname. |
RUNPOD_GPU_COUNT | Number of GPUs available. |
RUNPOD_CPU_COUNT | Number of CPUs available. |
RUNPOD_PUBLIC_IP | Public IP address (if available). |
RUNPOD_TCP_PORT_22 | Public port mapped to SSH. |
RUNPOD_VOLUME_ID | Attached network volume ID. |
RUNPOD_API_KEY | Pod-scoped API key. |
PUBLIC_KEY | Authorized SSH public keys. |
CUDA_VERSION | Installed CUDA version. |
PYTORCH_VERSION | Installed PyTorch version. |
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.