Environment Variables¶
Set secrets and configuration for your apps. Environment variables are injected into your app process at startup.
Setting Environment Variables¶
Via plitho.yml¶
apps:
- name: myapp
env:
NODE_ENV: production
DATABASE_URL: postgres://user:pass@localhost:5432/mydb
API_KEY: your-secret-key
Via the Dashboard¶
- Go to Apps → your app → Environment tab
- Add or edit variables
- Click Save
Changes require a restart — click Reload on the app.
How They Work¶
- Variables are stored securely in the Plitho database
- They persist across deploys and restarts
- Changes take effect after a restart
- The
PORTvariable is auto-set to yourserver_port— don't set it manually
Common Variables¶
| Variable | Description | Example |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | postgres://user:pass@host:5432/db |
REDIS_URL |
Redis/Valkey connection string | redis://:pass@host:6379 |
PORT |
Auto-set by Plitho | 3000 |
NODE_ENV |
Node.js environment | production |
PYTHONUNBUFFERED |
Python output buffering | 1 |
SECRET_KEY |
App secret (Django, etc.) | your-secret-key |
Note
Don't put secrets in plitho.yml if your repo is public. Use the dashboard to set sensitive variables instead — they're stored separately and not exposed in git history.