How-to · Hosting

Set environment variables for your website or app

Plans: HostingChecked 2026-11-21
On this pageBefore you startStepsIf it does not work

You want your website’s or app’s passwords, keys and settings outside its code, and changed without a new upload.

Before you start

  • Plans: every hosting plan.
  • Any website works: a PHP site in public_html or an app (run an app). Nothing needs deploying first.
  • Who gets the variables: your PHP site or app, its Build command at each deploy (so a database migration can run then), its workers (app workers) and your scheduled tasks (scheduled tasks).
  • A name is letters, digits and _, does not start with a digit and is at most 64 characters, like DATABASE_URL. A value is at most 32 KB and can’t be empty.
  • On a PHP site, a value is one line and does not start with $. For a key file, upload the file outside public_html and save its path as the value.
  • Some names are reserved, in capitals or small letters: PORT, HOME, USER, PATH, SHELL, PHPRC, HTTPS, the web request’s own names (such as DOCUMENT_ROOT, REMOTE_ADDR, SERVER_NAME, REQUEST_URI) and names starting HTTP_, PHP_, LD_, REDIRECT_, PASSENGER_, ITTICK_ or FCGI_. DATA_DIR is set for an app to the data folder in your home, which stays across deploys; save it only to point it somewhere else.
  • Your AI agent can do this too through AI Connectors: a hosting token shows your variables’ names; saving and removing them need the AI write add-on (set_app_variable, remove_app_variable, what each tool does). A value sent by your agent is at most 4 KB.

Steps

  1. Open the IT Tick Panel from your dashboard and press Apps in the left menu. If you have more than one website, pick it next to Your websites at the top.
    Screenshot of step 1
  2. To add a variable, go to Add or change a variable, write the Name and Value and press Save variable. The name appears under Variables, and the panel shows:
    • on a PHP site: “ITT_GREETING saved; PHP has it now.”
    • on an app: “DATABASE_URL saved; the app restarted with it.”
    Screenshot of step 2
  3. The value is hidden for good after you save it: the panel shows only names. To change a value, save the same Name again with the new Value.
    Screenshot of step 3
  4. To remove a variable, press Remove next to its name under Variables. The panel shows “ITT_GREETING removed.”
    Screenshot of step 4
  5. When the new value counts:
    • PHP site: at once, with no restart. PHP reads it with getenv('NAME') or $_SERVER['NAME']; $_ENV stays empty, as PHP’s default. A removed variable is gone at once too.
    • App: saving or removing restarts the app with the new values.
    • Workers keep the old values until you press Restart on each worker. Scheduled tasks get the new values at their next run, and the Build command at the next Deploy.
    Screenshot of step 5
  6. You can still keep settings in your own file. When the same name is in both:
    • Laravel and Symfony (.env): the value saved in the panel wins; names that are only in .env still load.
    • WordPress (wp-config.php): the file’s value wins, because its settings are code. To use the panel’s value, write getenv('NAME') in wp-config.php.
    • An app’s .env inside app (node --env-file=.env, python-dotenv or the dotenv gem): the value saved in the panel wins, unless your code turns on overwriting (override=True in python-dotenv, overwrite: true in the dotenv gem).
    Screenshot of step 6
  7. Keep secrets out of Git. When you deploy from GitHub or GitLab, each deploy is a fresh copy of your repository, so save passwords and keys in the panel and add .env to your .gitignore.

If it does not work

  • “HTTP_HOST is a reserved name: the server, PHP or the web request already sets it. Pick another name, such as MY_HTTP_HOST.”: the name is reserved (see Before you start); save it under another name, such as the one the panel suggests.
  • “A name is letters, digits and _, and doesn’t start with a digit.”: use only letters, digits and _, and start with a letter or _.
  • “PHP takes a value only on one line and not starting with $. For a key file, upload the file outside public_html and put its path in the variable.”: put the value on one line, or upload the key file outside public_html and save its path.
  • “A value can’t be empty. To clear a variable, remove it.”: press Remove next to the name instead.
  • Your PHP site still sees the old value: your own file sets the same name and wins (step 6), as in wp-config.php.
  • Your app still sees the old value: the name is also set in a loader that overwrites (step 6), or your app read it only at its start; press Restart. For a worker, press Restart on the worker.
  • You just changed the site’s PHP version: PHP has the variables back within a minute.
  • The build can’t find a variable: it is read at the next Deploy; press Deploy again after saving it.
  • You forgot a value you saved: it can’t be shown again. Save the name again with the right value.

Still stuck? A person will help.

Standard support comes with every plan. Premium is an add-on.

StandardA person replies within 24 hours. Included. Help docs and tickets; for a problem on our side, write any hour to support@it-tick.com.
Premium supportA person replies within 1 hour, 09:00-21:00 Cairo time, every day (guidance only). $49 a month.
See support tiersWe support our services (domain, hosting account, email, workspace), not your website or WordPress code.
Updated 2026-11-21Written by IT TickOpen-source credits
Ask support