# Environment (settings file, .env)

The settings and secrets your site reads, such as database passwords. How to edit them, what happens after saving, and who can see them.

The **Environment** holds the settings and secrets your site reads, such as its database password or the key of an email service. Some pages call it **the settings file**. Technical name: environment variables, the `.env` file.

Open the site, then the **Updates** tab, then **Environment**.

Only kinds of site that read a `.env` file have this page. An Odoo instance keeps its settings in `odoo.conf`, changed on **Odoo settings**; a WordPress site keeps them in `wp-config.php`; plain HTML, phpMyAdmin, an app on a port and Soketi read none. A static site built with Node.js calls it **Build settings**: the values its build reads.

![The Environment page of a site: the settings file is hidden until you choose Show the settings file, with the After saving switches under it](https://internal.fuzops.com/docs-img/site-environment.webp "Environment. The settings file stays hidden until you show it.")

## Show and hide it

The settings file starts **hidden**, so nobody reads your passwords over your shoulder. Choose **Show the settings file** to see and edit it, and **Hide** to put it away again. While it is hidden, nothing of it is on the page and it cannot be copied.

## Edit it

- One setting per line, written as `NAME=value`, for example `APP_ENV=production`. Lines starting with `#` are notes for people.
- The editor colours names, values and notes, shows line numbers, and has **Find** (Ctrl+F, or Cmd+F on a Mac) with replace, upper and lower case and patterns. **Ctrl+S** (Cmd+S) saves.
- Under the editor, Fuzops points at lines that need a look: a name that is set twice, a line that is not `NAME=value`, a value with spaces or `#` that needs double quotes, a value that looks like a placeholder, and names Fuzops sets for you (for example the address of an app it starts itself), which are replaced when it does. These notes are checked in your browser and never stop you saving.
- The values are stored encrypted and kept between updates: every new version reads the same settings.
- **Save** keeps your changes and writes them to the server, then does what you ticked under **After saving**. **Save and publish update** saves and publishes a new update straight away, so the new version starts with the new settings.

### As a list

**As a list** shows the same file as rows of a name and a value, for those who prefer a form to a text file. Each value stays hidden until you show that row. **Add a setting**, remove a row, or move it up and down. Notes and empty lines keep their place, and switching back to **As text** changes nothing you did not change.

### Read from server

**Read from server** reads the settings file as it is on the server now. When someone changed it there by hand, you see what differs: lines with **+** are only on the server, lines with **-** only in Fuzops. Choose **Use the server's version** to put it in the editor, or **Keep mine**. Nothing changes until you press **Save**. The copy from the server is read just for you and is not kept.

### Suggested settings

When a site has no settings yet and Fuzops knows the usual ones for its kind, it offers **Fill in suggested settings**. **Reset to the suggested settings** fills the editor with the usual settings again; your secret keys and database password are kept, and nothing is saved until you press **Save**.

When you add a site with **Create a database for this site**, the database name, user and password are written here for you.

## When two people edit it

If someone saved the file after you opened it, your save is refused instead of replacing theirs. What you typed stays in the editor, with who saved and when (the name only if your role may see the team's activity). **Reload** shows their version; **Show what changed** lists the lines their save has and yours would replace (−) and the lines only in yours (+); passwords and keys show as `••••••` unless your role may see them. Owners and Admins can then choose **Save mine anyway**.

If your sign-in ends while you edit, the lines you added or changed are kept in this browser tab (only if your role may see passwords and keys) and put back over the file after you sign in again. They are cleared when you save or sign out.

## After saving

Your app may need a nudge to read new settings. Under **After saving**, switch on what should happen; your choice is remembered for the site:

| Choice | What it does |
|---|---|
| **Restart the app** | So it reads the new settings. A short break for visitors. |
| **Refresh the settings cache** | Laravel reads the new settings right away. Technical name: config cache. |
| **Reload PHP** | Running requests finish first. Technical name: PHP-FPM reload. |
| **Restart background workers** | They finish their current job, then start with the new settings. Technical name: `queue:restart`. |

Only the choices that fit the kind of site are shown. What happened appears in the server's **Activity log** once it ran.

## Who can see it

The Environment holds secrets, so only owners, admins and developers can show it. Viewers and clients never see it, and Fuzops support staff cannot read it either.

- **Owners and admins** always see and change every value.
- **Developers** see every setting name and the ordinary values. Passwords and keys show as `[hidden]` unless the team turned on **Developers can see passwords and keys in settings files and environment files** (under **Members**). A value counts as a password or key when its name says so (such as `KEY`, `SECRET`, `PASSWORD`, `TOKEN` or `DSN`) or when it looks like one (an address with a password in it, an application key, a long random string). Developers can add settings and change the ordinary ones. Leave a `[hidden]` line as it is: its value is kept exactly when you save. Changing or removing a hidden value is refused with a sentence saying who can do it.

The same rule applies to **Read from server**, **Reset to the suggested settings** and the API. See [Team, roles and access](https://internal.fuzops.com/docs/team-and-access).

> **Warning:**
> Keep secrets out of your code repository. Put them here instead: they stay on the server and in Fuzops, encrypted.

## Several servers

When a site runs on more than one server, every server gets the same Environment. Point it at one database that all servers can reach. See [Several servers](https://internal.fuzops.com/docs/several-servers).

## Related

- [Updates](https://internal.fuzops.com/docs/updates)
- [Databases](https://internal.fuzops.com/docs/databases)
