Client Area

Environment Variables

3 min readPublished 6 Apr 2026Updated 22 Aug 2026302 views

In this article

  • 1Adding a variable
  • 2How they are protected
  • 3System variables — set for you, and not editable
  • 4Using an external database instead
  • 5Your app must read the port from the environment

Environment Variables

Environment variables are how you give your app its configuration and secrets — API keys, connection strings, feature flags — without putting them in your code.

Adding a variable

  1. Open your app and go to the Env Vars tab
  2. Click Add Variable
  3. Enter the name (for example STRIPE_SECRET_KEY) and the value
  4. Save — your app restarts automatically, usually within 5–10 seconds

How they are protected

  • Values are encrypted at rest
  • Values are masked in the dashboard once saved, so they are not readable over your shoulder
  • Variables are private to your app

System variables — set for you, and not editable

Some variables are managed by the platform:

VariableWhat it is
PORTThe port your app must listen on
DATABASE_URLThe connection string for your PostgreSQL database

You cannot change or delete these, and that is deliberate. If you try, you will see "Cannot modify system variable". This protects your app from losing its database connection — it is not a fault.

DATABASE_URL is re-applied on every deploy. If you overwrite it, your change will be replaced the next time you deploy.

Using an external database instead

If you want to connect to a database you host elsewhere, do not try to overwrite DATABASE_URL. Add your own variable under a different name — for example EXTERNAL_DATABASE_URL — and read that in your code.

Your app must read the port from the environment

javascript
// Node.js
const port = process.env.PORT || 3000;
app.listen(port, '0.0.0.0');
python
# Python
port = int(os.environ.get('PORT', 5000))
app.run(host='0.0.0.0', port=port)

Bind to 0.0.0.0, never localhost — an app listening on localhost cannot be reached from outside its container.

Good practice

  • Never commit secrets to git — use variables instead
  • Use clear names: STRIPE_SECRET_KEY, not KEY1
  • Names are case-sensitive: DATABASE_URL is not the same as database_url
  • Watch for trailing spaces in pasted values

Setting several at once

You can set multiple variables in one request from your terminal:

bash
curl -X POST https://<your panel address>/api/client/paas/{appId}/env \
  -H "Content-Type: application/json" \
  -d '{"vars": {"KEY1": "value1", "KEY2": "value2"}}'

If a variable does not seem to apply

  • Confirm it is listed in the Env Vars tab
  • Check the spelling and capitalisation
  • Your app restarts automatically after a change — check the Logs tab to confirm it restarted cleanly

Was this article helpful?

Your feedback helps us improve our documentation

Still need help? Submit a support ticket

Environment Variables - Knowledge Base