Theme
Environment variables
Per-site environment variables inject configuration into PHP-FPM, Node, Python, and Dockerfile runtimes. Values are encrypted at rest in the panel database.
Who can use this page? Site manage. Reveal of sensitive values requires re-authentication and is audited.
Open the editor
Site Actions → Environment Variables
Normal View
Edit one variable at a time:
| Property | Meaning |
|---|---|
| Key | Variable name (DATABASE_URL, APP_KEY, …) |
| Value | Stored encrypted if sensitive |
| Sensitive | Masked after save; excluded from builds; reveal is gated |
| Available at build time | Injected into Node build containers / Docker build args |
Only enable Available at build time for non-sensitive frontend configuration. Credentials, API secrets, database URLs, and signing keys must stay runtime-only — image history and build caches can expose build args.
Revealing a sensitive value
- Choose reveal / Developer View for a sensitive key.
- Re-enter your NitHost password (or 2FA code).
- The value is shown for a short window (about 90 seconds), non-cacheable, scoped to your user and site, and recorded for account security.
Developer View
Bulk paste KEY=VALUE lines (safe .env import):
- Saves are transactional: add/update only — omitted keys are not deleted
- Existing sensitivity and build-time flags are preserved
- New imported keys default to Sensitive and runtime-only
- Saved sensitive values are never exported back into the editor as plaintext
Use Normal View afterwards to flip flags on individual keys.
Migration tip
When moving from another host, paste production variables in Developer View, preview the change set, save, then adjust sensitivity in Normal View.
Linking databases
When you create a database with a linked site, NitHost can add:
| Engine | Default keys |
|---|---|
| PostgreSQL | DATABASE_URL (sensitive, runtime), DB_NAME |
| MongoDB | MONGO_URL (sensitive, runtime), DB_NAME |
Existing keys are never overwritten — resolve collisions or disable auto variables and copy the one-time credentials yourself.
After changing variables
- PHP — next request picks them up (FPM pool)
- Node / Python / Dockerfile — Restart the app from Site actions
- Git builds — redeploy so the new runtime env applies