# Environment variables

This page describes the environment variables that are supported in the `config/variables.env` file for Toolkit deployments.

The `config/variables.env` file consists of variable definitions in the form `NAME=value`, lines beginning with `#` are treated as comments.

{% hint style="info" %}
It is necessary that you re-create the Docker containers after changing anything in `overleaf.rc` or `variables.env` by running `bin/up`.
{% endhint %}

### All versions

These environment variables are compatible with Server CE and Server Pro you with an easy migration path between these two on-premise versions. They can also be used with both Toolkit and Docker Compose deployments.

{% hint style="info" %}
Previously, these environment variables were prefixed with `SHARELATEX_` instead of `OVERLEAF_`.
{% endhint %}

<table data-full-width="false"><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>OVERLEAF_SITE_URL</code></td><td>Where your instance of Overleaf is publicly available. This is used in public links, and when connecting over websockets, so must be configured correctly!</td></tr><tr><td><code>OVERLEAF_ADMIN_EMAIL</code></td><td>The email address where users can reach the person who runs the site.</td></tr><tr><td><code>OVERLEAF_APP_NAME</code></td><td>The name to display when talking about the running application. Defaults to 'Overleaf (Community Edition)'.</td></tr><tr><td><code>OVERLEAF_MONGO_URL</code> and <code>MONGO_URL</code></td><td>The URL of the Mongo database to use.</td></tr><tr><td><code>OVERLEAF_REDIS_HOST</code> and <code>REDIS_HOST</code></td><td>The host name of the Redis instance to use. Both are required (see <a href="/pages/TFzRg7NXAdCk2cXanTGv#changes-to-the-docker-compose-file-format">release notes</a>)</td></tr><tr><td><code>OVERLEAF_REDIS_PORT</code> and <code>REDIS_PORT</code></td><td>The port of the Redis instance to use. Both are required (see <a href="/pages/TFzRg7NXAdCk2cXanTGv#changes-to-the-docker-compose-file-format">release notes</a>)</td></tr><tr><td><code>OVERLEAF_REDIS_PASS</code> and <code>REDIS_PASSWORD</code></td><td>The password to use when connecting to Redis (if applicable). <strong>Both</strong> environment variables need to be set. See <a href="/pages/QKHEWQpICv5GoRDPtPkK">enabling password authentication</a> for more infomration.</td></tr><tr><td><code>OVERLEAF_REDIS_TLS</code></td><td><p>If set to <code>true</code>, allows for the connection to a Redis instance requiring TLS. </p><p></p><p><strong>Note:</strong> mTLS is currently not supported.</p></td></tr><tr><td><code>OVERLEAF_NAV_TITLE</code></td><td>Set the tab title of the application</td></tr><tr><td><code>OVERLEAF_SESSION_SECRET</code></td><td>A random string which is used to secure tokens, if load balancing this needs to be set to the same token across boxes. If only 1 instance is being run it does not need to be set by the user.</td></tr><tr><td><code>OVERLEAF_COOKIE_SESSION_LENGTH</code></td><td>This environment variable allows you to override the default session cookie expiration time of 5 days. The override value provided should be specified in milliseconds. For example, to make the session last for 1 hour, set <code>COOKIE_SESSION_LENGTH=3600000</code>. (Added in Server Pro 4.2)</td></tr><tr><td><code>OVERLEAF_TRUSTED_PROXY_IPS</code></td><td><p>If not set, defaults to <code>loopback</code>. If setting manually, in addition to your trusted IPs, you must also include one of <code>loopback</code>, <code>localhost</code> or <code>127.0.0.1</code>, which trusts the nginx instance running inside the <strong>sharelatex</strong> container.<br><br>If using a subnet from <code>172.16.0.0/12</code> (default subnet for Docker networks) for your regular network, please set <code>OVERLEAF_TRUSTED_PROXY_IPS=loopback,&#x3C;network></code> in your <code>config/variables.env</code>. Where <code>&#x3C;network></code> is the <code>IPAM -> Config -> Subnet</code> value in <code>docker inspect overleaf_default</code>, e.g. <code>OVERLEAF_TRUSTED_PROXY_IPS=loopback,172.19.0.0/16</code>. This is to prevent the spoofing of <code>X-Forwarded</code> headers.</p><p><br>If you are using an external TLS proxy (i.e. not managed by the Overleaf Toolkit), please ensure that <code>OVERLEAF_TRUSTED_PROXY_IPS=loopback,&#x3C;ip-of-your-tls-proxy></code>, e.g. <code>OVERLEAF_TRUSTED_PROXY_IPS=loopback,192.168.13.37</code>.</p></td></tr><tr><td><code>OVERLEAF_RESTRICT_INVITES_TO_EXISTING_ACCOUNTS</code></td><td>If set to <code>true</code>, will restrict project invites to email addresses which correspond with existing user accounts.</td></tr><tr><td><code>OVERLEAF_ALLOW_PUBLIC_ACCESS</code></td><td>If set to <code>true</code>, will allow non-authenticated users to view the site. The default is <code>false</code>, which means non-authenticated users will be unconditionally redirected to the login page when they try to view any part of the site. Note, setting this option does not disable authentication or security in any way. This option is necessary if your users intend to make their projects public and have non-authenticated users view those projects.</td></tr><tr><td><code>OVERLEAF_ALLOW_ANONYMOUS_READ_AND_WRITE_SHARING</code></td><td><p>If set to <code>true</code>, will allow anonymous users to view and edit projects shared via the  </p><p><a href="https://www.overleaf.com/blog/integration-update-link-sharing-2017-11-27">link-sharing</a> feature.</p></td></tr><tr><td><code>OVERLEAF_DISABLE_LINK_SHARING</code></td><td>Disables the <a href="https://www.overleaf.com/blog/integration-update-link-sharing-2017-11-27">link-sharing</a> feature.</td></tr><tr><td><code>EMAIL_CONFIRMATION_DISABLED</code></td><td>When set to <code>true</code> the banner requesting email confirmation won't be displayed.</td></tr><tr><td><code>ADDITIONAL_TEXT_EXTENSIONS</code></td><td>an array of strings to configure additional extensions for editable files</td></tr><tr><td><code>OVERLEAF_STATUS_PAGE_URL</code></td><td>Custom status page URL (Added in Server Pro 3.4.0), e.g. <code>status.example.com</code></td></tr><tr><td><code>OVERLEAF_FPH_INITIALIZE_NEW_PROJECTS</code></td><td>set to <code>'false'</code> to prevent new projects from being initialised with Full Project History (Added in Server Pro 3.5.0)</td></tr><tr><td><code>OVERLEAF_FPH_DISPLAY_NEW_PROJECTS</code></td><td>set to <code>'false'</code> to prevent new projects from displaying Full Project History instead of the legacy history (Added inServer Pro 3.5.0)</td></tr><tr><td><code>ENABLE_CRON_RESOURCE_DELETION</code></td><td>Set this environment variable to <code>true</code> to enable the automatic clean-up of deleted projects and users after 90 days.</td></tr><tr><td><code>OVERLEAF_USER_HARD_DELETION_DELAY</code> </td><td>Used to modify the deleted users expiration delay. Configured in milliseconds.<br><br><strong>Defaults:</strong> 90 days</td></tr><tr><td><code>OVERLEAF_PROJECT_HARD_DELETION_DELAY</code></td><td>Used to modify the deleted projects expiration delay. Configured in milliseconds.<br><br><strong>Defaults:</strong> 90 days</td></tr><tr><td><code>COMPILE_SIZE_LIMIT</code></td><td>Controls the maximum request body size in bytes. This is the sum of all doc file sizes within the project (<strong>main.tex</strong>, <strong>references.bib</strong> (if not linked) etc), that needs to be sent in the initial compile request to the CLSI service.</td></tr><tr><td><code>COMPILE_TIMEOUT</code></td><td>This is the amount of time in seconds allowed for a compile to complete. For more information see <a href="/pages/5K2fBABoG0fu3FnVnlc1#updating-project-compile-timeout">Updating project compile timeout</a>.</td></tr><tr><td><code>MAX_RECONNECT_GRACEFULLY_INTERVAL_MS</code> </td><td>A configurable delay between editor graceful reconnection, data flushing, and container shutdown to mitigate the risk of data loss.</td></tr><tr><td><code>SECCOMP_PROFILE</code></td><td>Set this environment variable to a path on the Docker <strong>host</strong> machine that points to the SECCOMP profile. You can download a copy of the profile <a href="https://raw.githubusercontent.com/overleaf/overleaf/365af778b68a7940e08282119dc4ef473e2f0044/services/clsi/seccomp/clsi-profile.json">here</a>.<br><br>Currently needed for Podman deployments when using Sandboxed Compiles.</td></tr><tr><td><code>OVERLEAF_DISABLE_CHAT</code></td><td>If set to <code>true</code>, disables the in-project chat feature.</td></tr><tr><td><code>OVERLEAF_LOGIN_SUPPORT_TEXT</code></td><td>When set, can be used to display support information underneath the login button. Text will be shown on the login screen and can be used to direct users to internal support or provide guidance related to logging in, creating accounts, etc.</td></tr><tr><td><code>ALLOW_MONGO_ADMIN_CHECK_FAILURES</code></td><td>If set to <code>true</code>, allows the MongoDB start-up checks to fail and not prevent the deployment from starting. This may be required if you use a MongoDB database where your database user does not have the <code>clusterParameterReader</code> role. <br><br>For help on creating a custom role see <a href="/pages/zscsmMyFQZPjrxoF10O3#creating-a-custom-role">here</a>.</td></tr><tr><td><code>V1_HISTORY_URL_FOR_GIT_BRIDGE</code></td><td>Allows separating the <strong>history-v1</strong> endpoint for internal traffic (<code>web</code> service → <code>history-v1</code> service, both in <code>sharelatex</code> container) and external traffic (<code>git-bridge</code> → <code>history-v1</code>, running in separate containers).</td></tr><tr><td><code>OVERLEAF_MAINTENANCE_MESSAGE</code> and <code>OVERLEAF_MAINTENANCE_MESSAGE_HTML</code></td><td><p>Used to customize the title and content of the Maintenance page. </p><p></p><p>Can't be used with <code>OVERLEAF_STATUS_PAGE_URL</code></p></td></tr></tbody></table>

{% hint style="info" %}
It is possible to enforce password restrictions on users when using the Overleaf login system (local accounts), not an SSO option such as LDAP. For SSO accounts, password policies will be enforced by your identity provider or directory service, additionally allowing support for multi-factor authentication.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.overleaf.com/on-premises/configuration/overleaf-toolkit/environment-variables.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
