# Configuration using environment variables
URL: /docs/ottofms/managing-ottofms/configuring-with-env

***

## title: Configuration using environment variables

import { File, Folder, Files } from "fumadocs-ui/components/files";

Most OttoFMS settings are available from the OttoFMS console, but some settings are only available via environment variables, set in the server environment or in an `.env` file in the OttoFMS config directory. The `.env` file is a text file that contains key-value pairs that are used to configure the OttoFMS server. The `.env` file is located in the OttoFMS config directory, which is located inside of the OttoFMS application folder. It can also be found in the OttoFMS File Browser under OttoFMS Config.

<div className="item-group">
  <div className="file-tree-small-top-margin">
    <p style={{ marginTop: 16, fontSize: "1.1rem", fontWeight: "bold" }}>In the File Browser:</p>

    <Files>
      <Folder name="OttoFMS Config" defaultOpen>
        <File name=".env" />
      </Folder>
    </Files>
  </div>

  <div className="file-tree-small-top-margin">
    <p style={{ marginTop: 16, fontSize: "1.1rem", fontWeight: "bold" }}>In the Server File System:</p>

    <Files>
      <Folder name="OttoFMS Application Folder" defaultOpen>
        <Folder name="config" defaultOpen>
          <File name=".env" />
        </Folder>
      </Folder>
    </Files>
  </div>
</div>

## Environment level settings

### Custom FileMaker Server Configuration

If you are using a custom FileMaker server configuration (ie. a non-standard install directory or a different fmserver username and password) you can set these values in the `.env` file. The following keys are available:

* FMS\_SERVER\_PATH=/path/to/fmserver

### Just In Time Build Management

By default, OttoFMS deletes Just In Time builds from the source server after they are used. If you would like to keep just in time builds on the source, you can set the following key on the destination server:

* KEEPJIT=1

### OttoFMS Debug Logging

<Callout type="info">
  The recommended way to turn on Debug Logging after OttoFMS version 4.10.0 is
  via the toggle in the [OttoFMS Config
  settings](/docs/ottofms/otto-console/settings#debug-logging). This will turn on debug
  logging without requiring a full OttoFMS restart.
</Callout>

OttoFMS has a debug logging mode that can be enabled by setting the following key:

* DEBUG=true

OttoFMS debug logs include more information than the default logging. This can be useful for debugging issues with builds, deployments, and other OttoFMS processes.

### App Log Debug logs

The App Log can be configured to log an extra level of messages for debugging purposes. To enable debug logs, set the following key:

* DEBUG\_APP\_LOG=true

This enables sending logs with the "debug","verbose", and "http" levels to a new log file called `app-debug.log`. See the App Log Guide for details on setting up application logging with OttoFMS.

### Just In Time Build timeout

When running a deployment, Just in Time builds can be used to create a build on the source server. If creating copies of very large files these can take a long time. By default, OttoFMS will time out of a Just In Time build after 30 minutes. If you would like to change this timeout, you can set the following key:

* JIT\_BUILD\_TIMEOUT\_IN\_SEC=3600

### fmsadmin Timeout

OttoFMS uses the fmsadmin tool to list files, open and close files, and perform other operations on the server. By default, OttoFMS will wait 20 seconds for the fmsadmin tool to complete its operation. If you would like to change this timeout, you can set the following key:

* FMSADMIN\_TIMEOUT\_IN\_SEC=60

This setting does not affect the timeout when performing backups, if you'd like to change the backup timeout, see below.

### Backup Timeout

When running a backup, the backup process can take a long time. By default, OttoFMS will time out of a backup after 10 minutes. If you would like to change this timeout, you can set the following key:

* BACKUP\_FILE\_TIMEOUT\_IN\_SEC=600

### Build and Deployment script timeouts

When running a build or deployment, OttoFMS exposes a pre-build, pre-deployment, and post-deployment script. These scripts can take a long time to run, and OttoFMS has a default timeout of 1 hour, at which point OttoFMS will throw an error and possibly abort the build or deployment. If you would like to change this timeout, you can set the following keys:

* PRE\_BUILD\_SCRIPT\_TIMEOUT\_IN\_SEC=3600
* PRE\_DEPLOYMENT\_SCRIPT\_TIMEOUT\_IN\_SEC=3600
* POST\_DEPLOYMENT\_SCRIPT\_TIMEOUT\_IN\_SEC=3600

These timeouts can also be overridden on a per-build or per-deployment basis by setting the timeout in the script options.

### Changing the migration folder

When running a deployment that migrates files, OttoFMS migrates the data from your current live file to a temporary file which is stored in the build inbox. This works well for servers where there is only a single disk, but it can cause slow-downs on servers where the backup folder is on a different disk than the live databases as the build inbox is stored within the default backup directory.

To get around this issue, you can set the `USE_DATABASE_FOLDER_FOR_MIGRATIONS` key to "true" in your env file. This will perform the migration into the `Removed_By_FMS/Removed` folder within your database folder, avoiding the need to migrate large quantities of data across disk boundaries. .

<Callout type="warning">
  Be aware that migrating within the database folder has fewer protections than
  performing the migration in the build inbox, as OttoFMS will not check to see
  that you have enough disk space to perform the migration on your database disk
  and the migrated file may not be deleted if the deployment does not complete
</Callout>

* USE\_DATABASE\_FOLDER\_FOR\_MIGRATIONS=true

### Hide Server Details for Demos

If you want to do a demo of OttoFMS and you'd like to hide server details like urls and ip addresses, you can set the following key:

* PUBLIC\_HIDE\_SERVER\_INFO=true

### Specify the OttoFMS license key

If you would like to specify the OttoFMS license key programmatically instead of setting it in the OttoFMS console, you can set the following key in the environment or the `.env` file:

* OTTOFMS\_LICENSE=your-license-key

### Add Trusted Root Certificates on Windows and Linux

To add trusted root certificates on Windows and Linux, you can set the `NODE_EXTRA_CA_CERTS` environment variable to point to a file containing your root certificates.

* NODE\_EXTRA\_CA\_CERTS=/path/to/your/root-certificates.pem

### Preventing Callout to Server Hostname in Data API and OData Proxies

By default, OttoFMS will call back out from the server to the hostname to send calls to the Data API and OData proxies. This primarily fixes issues with container data urls, as the urls need the server url to be generated properly. If you would like to disable this behavior, you can set the following key:

* PREVENT\_DAPI\_CALLOUT=true

## Example .env File

Here is an example of an `.env` file for OttoFMS:

```
FMS_SERVER_PATH=/path/to/fmserver
KEEPJIT=1
DEBUG_APP_LOG=true
```
