Skip to content

Set environment variables

Environment variables are the settings and keys your site reads while it builds and runs, such as DATABASE_URL or STRIPE_SECRET_KEY. Keep them here rather than in your site’s files, so they never end up in a version anyone can download.

Find them on your site’s Environment variables tab. You can add them once your site has its first files.

  • Owners and admins can show, copy, add, edit and remove variables.
  • Members see the names only. Values stay hidden.
  • AI tools connected to Cloudzyro can’t see or set environment variables at all.

Values are hidden until you choose to show them. A value marked Sensitive can never be shown again, by anyone, including you.

  1. Click Add variable.

  2. Type the Name, such as DATABASE_URL. Names can use letters, numbers and underscores, and can’t start with a number.

  3. Type the Value. Values can be up to 32 KB.

  4. Tick Sensitive if it’s a secret you never need to see again. If the name looks like a secret, we suggest ticking it.

  5. Click Add variable.

  1. Click Add variable, then Paste a .env file instead. Or just paste .env lines into Name: we spot them and switch for you.

  2. Paste your lines, one NAME=value per line. Comments and blank lines are ignored. We list the names we found.

  3. Tick Sensitive if you want it for all of them.

  4. Click Add variable (or Add 3 variables, and so on).

When you upload files that include a .env file, we leave the file out and offer Add them now. Values added that way are saved as sensitive.

Each variable has buttons beside it:

  • Show value and Hide value reveal or hide it on the page.
  • Copy name and Copy value copy them to your clipboard.
  • Edit opens the variable with its current value filled in. Change it and click Save.
  • Remove asks you to confirm. Your site won’t have the variable from its next deploy.

Use Filter by name to find a variable when you have a lot of them.

A Sensitive variable shows a lock instead of its value, and has no Show or Copy button. You can still replace it: click Edit, enter the new value and click Save.

To make a sensitive variable viewable again, click Edit, enter its value again and untick Sensitive.

Changes apply on your site’s next deploy. After you add, edit or remove a variable, click Deploy now to put your site online again straight away with the new values. Your current version stays online until the new one is ready.

If your site is connected to a repository, the next push also picks up the changes.

To connect a database, use the site’s Database tab instead. It tests the connection and names the variables the way your code expects, then saves them here. See Connect a database.