How-to · Hosting
Set environment variables for your website or app
Plans: HostingChecked 2026-11-21
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_htmlor 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, likeDATABASE_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 outsidepublic_htmland 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 asDOCUMENT_ROOT,REMOTE_ADDR,SERVER_NAME,REQUEST_URI) and names startingHTTP_,PHP_,LD_,REDIRECT_,PASSENGER_,ITTICK_orFCGI_.DATA_DIRis set for an app to thedatafolder 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
- 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.

- 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.”

- 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.

- To remove a variable, press Remove next to its name under Variables. The panel shows “ITT_GREETING removed.”

- When the new value counts:
- PHP site: at once, with no restart. PHP reads it with
getenv('NAME')or$_SERVER['NAME'];$_ENVstays 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.

- PHP site: at once, with no restart. PHP reads it with
- 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.envstill load. - WordPress (
wp-config.php): the file’s value wins, because its settings are code. To use the panel’s value, writegetenv('NAME')inwp-config.php. - An app’s
.envinsideapp(node --env-file=.env, python-dotenv or the dotenv gem): the value saved in the panel wins, unless your code turns on overwriting (override=Truein python-dotenv,overwrite: truein the dotenv gem).

- Laravel and Symfony (
- 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
.envto 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_htmland 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.
Related
Was this helpful?
Thanks for telling us.
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.
