---
title: "Using environment variables in the site configuration"
manual: "TYPO3 Explained"
version: "14.3"
permalink: "https://docs.typo3.org/permalink/t3coreapi:sitehandling-using-env-vars@14.3"
source: "ApiOverview/SiteHandling/UsingEnvVars.rst"
rendered: "2026-09-20T12:29:08+00:00"
---

# Using environment variables in the site configuration {#sitehandling-using-env-vars}

Environment variables in the site configuration allows setting placeholders for
configuration options that get replaced by environment variables specific to the
current environment.

The format for environment variables is `%env(ENV_NAME)%`. Environment
variables may be used to replace complete values or parts of a value.

> [!NOTE]
> TYPO3 does not provide a loader for `.env` files - you have to take
> care of loading them yourself. Common options include setting environment
> configuration via server configuration or using [vlucas/phpdotenv](https://github.com/vlucas/phpdotenv) or
> [symfony/dotenv](https://github.com/symfony/dotenv).

## Examples {#sitehandling-using-env-vars-examples}

```yaml
base: 'https://%env(BASE_DOMAIN)%/'
```

When using environment variables in conditions, make sure to quote them
correctly:

```yaml
condition: '"%env(my_env)%" == "my_comparison_string"'
```
