2021-03-12 15:43:31 +00:00
---
2021-05-05 17:52:07 +00:00
title: Configuration
2021-03-12 15:43:31 +00:00
---
2021-05-05 17:52:07 +00:00
These are all the configuration options you can set via environment variables.
2021-03-12 15:43:31 +00:00
Append any of the following keys to your `.env` file, and run `docker-compose up -d` to apply them.
2021-05-08 15:14:14 +00:00
:::info
The double-underscores are intentional, as all these settings are translated to yaml internally, a double-underscore indicates the next level.
:::
All of these variables can be set to values, but you can also use a URI-like format to load values from other places:
2022-05-09 19:22:41 +00:00
- `env://<name>` Loads the value from the environment variable `<name>` . Fallback can be optionally set like `env://<name>?<default>`
- `file://<name>` Loads the value from the file `<name>` . Fallback can be optionally set like `file://<name>?<default>`
2021-05-08 15:14:14 +00:00
2022-09-21 07:59:03 +00:00
## Checking settings
To check if your config has been applied correctly, you can run the following command to output the full config:
```
docker-compose run --rm worker dump_config
# Or for kubernetes
kubectl exec -it deployment/authentik-worker -c authentik -- ak dump_config
```
2021-05-08 15:14:14 +00:00
## PostgreSQL Settings
2022-05-09 19:22:41 +00:00
- `AUTHENTIK_POSTGRESQL__HOST` : Hostname of your PostgreSQL Server
- `AUTHENTIK_POSTGRESQL__NAME` : Database name
- `AUTHENTIK_POSTGRESQL__USER` : Database user
- `AUTHENTIK_POSTGRESQL__PORT` : Database port, defaults to 5432
- `AUTHENTIK_POSTGRESQL__PASSWORD` : Database password, defaults to the environment variable `POSTGRES_PASSWORD`
2022-10-14 09:53:24 +00:00
- `AUTHENTIK_POSTGRESQL__USE_PGBOUNCER` : Adjust configuration to support connection to PgBouncer
2023-04-02 15:39:36 +00:00
- `AUTHENTIK_POSTGRESQL__SSLMODE` : Strictness of ssl verification. Defaults to `verify-ca`
- `AUTHENTIK_POSTGRESQL__SSLROOTCERT` : CA root for server ssl verification
- `AUTHENTIK_POSTGRESQL__SSLCERT` : Path to x509 client certificate to authenticate to server
- `AUTHENTIK_POSTGRESQL__SSLKEY` : Path to private key of `SSLCERT` certificate
2021-05-08 15:14:14 +00:00
## Redis Settings
2022-05-09 19:22:41 +00:00
- `AUTHENTIK_REDIS__HOST` : Hostname of your Redis Server
- `AUTHENTIK_REDIS__PORT` : Redis port, defaults to 6379
- `AUTHENTIK_REDIS__PASSWORD` : Password for your Redis Server
2023-04-23 08:37:53 +00:00
- `AUTHENTIK_REDIS__TLS` : Use TLS to connect to Redis, defaults to false
- `AUTHENTIK_REDIS__TLS_REQS` : Redis TLS requirements, defaults to "none"
2022-11-15 13:31:29 +00:00
- `AUTHENTIK_REDIS__DB` : Database, defaults to 0
2022-05-09 19:22:41 +00:00
- `AUTHENTIK_REDIS__CACHE_TIMEOUT` : Timeout for cached data until it expires in seconds, defaults to 300
- `AUTHENTIK_REDIS__CACHE_TIMEOUT_FLOWS` : Timeout for cached flow plans until they expire in seconds, defaults to 300
- `AUTHENTIK_REDIS__CACHE_TIMEOUT_POLICIES` : Timeout for cached policies until they expire in seconds, defaults to 300
- `AUTHENTIK_REDIS__CACHE_TIMEOUT_REPUTATION` : Timeout for cached reputation until they expire in seconds, defaults to 300
2021-05-08 15:14:14 +00:00
2022-08-03 19:33:27 +00:00
## Listen Setting
2022-09-05 18:37:11 +00:00
- `AUTHENTIK_LISTEN__HTTP` : Listening address:port (e.g. `0.0.0.0:9000` ) for HTTP (Server and Proxy outpost)
- `AUTHENTIK_LISTEN__HTTPS` : Listening address:port (e.g. `0.0.0.0:9443` ) for HTTPS (Server and Proxy outpost)
- `AUTHENTIK_LISTEN__LDAP` : Listening address:port (e.g. `0.0.0.0:3389` ) for LDAP (LDAP outpost)
- `AUTHENTIK_LISTEN__LDAPS` : Listening address:port (e.g. `0.0.0.0:6636` ) for LDAPS (LDAP outpost)
- `AUTHENTIK_LISTEN__METRICS` : Listening address:port (e.g. `0.0.0.0:9300` ) for Prometheus metrics (All)
- `AUTHENTIK_LISTEN__DEBUG` : Listening address:port (e.g. `0.0.0.0:9900` ) for Go Debugging metrics (All)
2023-07-06 16:16:26 +00:00
- `AUTHENTIK_LISTEN__TRUSTED_PROXY_CIDRS` : List of CIDRs that proxy headers should be accepted from (Server)
Defaults to `127.0.0.0/8` , `10.0.0.0/8` , `172.16.0.0/12` , `192.168.0.0/16` , `fe80::/10` , `::1/128` .
Requests directly coming from one an address within a CIDR specified here are able to set proxy headers, such as `X-Forwarded-For` . Requests coming from other addresses will not be able to set these headers.
2022-08-03 19:33:27 +00:00
2021-05-08 15:14:14 +00:00
## authentik Settings
2022-07-02 11:01:40 +00:00
### `AUTHENTIK_SECRET_KEY`
2021-09-05 17:58:42 +00:00
2021-09-24 13:37:54 +00:00
Secret key used for cookie signing and unique user IDs, don't change this after the first install.
2021-09-05 17:58:42 +00:00
2022-07-02 11:01:40 +00:00
### `AUTHENTIK_LOG_LEVEL`
2021-03-12 15:43:31 +00:00
Log level for the server and worker containers. Possible values: debug, info, warning, error
2021-12-21 12:14:09 +00:00
2022-05-09 19:22:41 +00:00
Starting with 2021.12.3, you can also set the log level to _trace_ . This has no affect on the core authentik server, but shows additional messages for the embedded outpost.
2021-12-21 12:14:09 +00:00
2022-09-29 09:27:35 +00:00
:::danger
Setting the log level to `trace` will include sensitive details in logs, so it shouldn't be used in most cases.
2022-09-29 09:52:48 +00:00
Logs generated with `trace` should be treated with care as they can give others access to your instance, and can potentially include things like session cookies to authentik **and other pages** .
2022-09-29 09:27:35 +00:00
:::
2021-03-12 15:43:31 +00:00
Defaults to `info` .
2022-07-02 11:01:40 +00:00
### `AUTHENTIK_COOKIE_DOMAIN`
2021-10-20 16:26:22 +00:00
Which domain the session cookie should be set to. By default, the cookie is set to the domain authentik is accessed under.
2022-12-20 21:09:30 +00:00
### `AUTHENTIK_GEOIP`
Path to the GeoIP database. Defaults to `/geoip/GeoLite2-City.mmdb` . If the file is not found, authentik will skip GeoIP support.
2022-07-02 11:01:40 +00:00
### `AUTHENTIK_DISABLE_UPDATE_CHECK`
2021-10-20 16:26:22 +00:00
Disable the inbuilt update-checker. Defaults to `false` .
2021-09-11 18:35:23 +00:00
2022-07-02 11:01:40 +00:00
### `AUTHENTIK_ERROR_REPORTING`
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
- `AUTHENTIK_ERROR_REPORTING__ENABLED`
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
Enable error reporting. Defaults to `false` .
2021-03-12 15:43:31 +00:00
2022-12-23 10:18:26 +00:00
Error reports are sent to https://sentry.io, and are used for debugging and general feedback. Anonymous performance data is also sent.
2021-03-12 15:43:31 +00:00
2022-11-15 15:05:29 +00:00
- `AUTHENTIK_ERROR_REPORTING__SENTRY_DSN`
2022-12-23 10:18:26 +00:00
Sets the DSN for the Sentry API endpoint.
2022-11-15 15:05:29 +00:00
When error reporting is enabled, the default Sentry DSN will allow the authentik developers to receive error reports and anonymous performance data, which is used for general feedback about authentik, and in some cases, may be used for debugging purposes.
Users can create their own hosted Sentry account (or self-host Sentry) and opt to collect this data themselves.
2022-05-09 19:22:41 +00:00
- `AUTHENTIK_ERROR_REPORTING__ENVIRONMENT`
2021-03-12 15:43:31 +00:00
2022-11-15 15:05:29 +00:00
The environment tag associated with all data sent to Sentry. Defaults to `customer` .
When error reporting has been enabled to aid in debugging issues, this should be set to a unique
value, such as an e-mail address.
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
- `AUTHENTIK_ERROR_REPORTING__SEND_PII`
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
Whether or not to send personal data, like usernames. Defaults to `false` .
2021-03-12 15:43:31 +00:00
2022-07-02 11:01:40 +00:00
### `AUTHENTIK_EMAIL`
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
- `AUTHENTIK_EMAIL__HOST`
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
Default: `localhost`
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
- `AUTHENTIK_EMAIL__PORT`
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
Default: `25`
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
- `AUTHENTIK_EMAIL__USERNAME`
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
Default: `` (Don't add quotation marks)
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
- `AUTHENTIK_EMAIL__PASSWORD`
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
Default: `` (Don't add quotation marks)
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
- `AUTHENTIK_EMAIL__USE_TLS`
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
Default: `false`
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
- `AUTHENTIK_EMAIL__USE_SSL`
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
Default: `false`
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
- `AUTHENTIK_EMAIL__TIMEOUT`
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
Default: `10`
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
- `AUTHENTIK_EMAIL__FROM`
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
Default: `authentik@localhost`
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
Email address authentik will send from, should have a correct @domain
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
To change the sender's display name, use a format like `Name <account@domain>` .
2022-02-24 09:39:33 +00:00
2022-07-02 11:01:40 +00:00
### `AUTHENTIK_OUTPOSTS`
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
- `AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE`
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
Placeholders:
2021-06-08 13:32:23 +00:00
2022-05-09 19:22:41 +00:00
- `%(type)s` : Outpost type; proxy, ldap, etc
- `%(version)s` : Current version; 2021.4.1
- `%(build_hash)s` : Build hash if you're running a beta version
2021-03-12 15:43:31 +00:00
2022-05-09 19:22:41 +00:00
Placeholder for outpost docker images. Default: `ghcr.io/goauthentik/%(type)s:%(version)s` .
2022-02-12 16:27:41 +00:00
2022-05-09 19:22:41 +00:00
- `AUTHENTIK_OUTPOSTS__DISCOVER`
2022-02-12 16:27:41 +00:00
2022-05-09 19:22:41 +00:00
Configure the automatic discovery of integrations. Defaults to `true` .
2022-02-12 16:27:41 +00:00
2022-05-09 19:22:41 +00:00
By default, the following is discovered:
- Kubernetes in-cluster config
- Kubeconfig
- Existence of a docker socket
2022-02-12 16:27:41 +00:00
2022-07-02 11:01:40 +00:00
### `AUTHENTIK_AVATARS`
2021-03-12 15:43:31 +00:00
2021-06-22 10:24:23 +00:00
Configure how authentik should show avatars for users. Following values can be set:
2021-03-12 15:43:31 +00:00
2023-02-12 15:35:17 +00:00
Default: `gravatar,initials`
2022-05-09 19:22:41 +00:00
- `none` : Disables per-user avatars and just shows a 1x1 pixel transparent picture
2023-02-12 15:35:17 +00:00
- `gravatar` : Uses gravatar with the user's email address
- `initials` : Generated avatars based on the user's name
2022-05-09 19:22:41 +00:00
- Any URL: If you want to use images hosted on another server, you can set any URL.
2021-06-22 10:24:23 +00:00
2022-05-09 19:22:41 +00:00
Additionally, these placeholders can be used:
2021-06-22 10:24:23 +00:00
2022-05-09 19:22:41 +00:00
- `%(username)s` : The user's username
- `%(mail_hash)s` : The email address, md5 hashed
- `%(upn)s` : The user's UPN, if set (otherwise an empty string)
2021-11-07 20:39:25 +00:00
2023-02-12 15:35:17 +00:00
Starting with authentik 2022.8, you can also use an attribute path like `attributes.something.avatar` , which can be used in combination with the file field to allow users to upload custom avatars for themselves.
Starting with authentik 2023.2, multiple modes can be set, and authentik will fallback to the next mode when no avatar could be found. For example, setting this to `gravatar,initials` will attempt to get an avatar from Gravatar, and if the user has not configured on there, it will fallback to a generated avatar.
2022-07-26 19:41:55 +00:00
2022-07-02 11:01:40 +00:00
### `AUTHENTIK_DEFAULT_USER_CHANGE_NAME`
2022-01-04 18:03:12 +00:00
:::info
Requires authentik 2021.12.5
:::
Enable the ability for users to change their name, defaults to `true` .
2022-07-02 11:01:40 +00:00
### `AUTHENTIK_DEFAULT_USER_CHANGE_EMAIL`
2021-11-13 21:33:03 +00:00
:::info
2021-12-18 14:34:39 +00:00
Requires authentik 2021.12.1
2021-11-13 21:33:03 +00:00
:::
2023-05-10 18:57:57 +00:00
Enable the ability for users to change their Email address, defaults to `false` .
2021-11-13 21:33:03 +00:00
2022-07-02 11:01:40 +00:00
### `AUTHENTIK_DEFAULT_USER_CHANGE_USERNAME`
2021-11-13 21:33:03 +00:00
:::info
2021-12-18 14:34:39 +00:00
Requires authentik 2021.12.1
2021-11-13 21:33:03 +00:00
:::
2023-05-10 18:57:57 +00:00
Enable the ability for users to change their Usernames, defaults to `false` .
2021-11-13 21:33:03 +00:00
2022-07-02 11:01:40 +00:00
### `AUTHENTIK_GDPR_COMPLIANCE`
2021-11-16 10:29:13 +00:00
:::info
2021-12-18 14:34:39 +00:00
Requires authentik 2021.12.1
2021-11-16 10:29:13 +00:00
:::
When enabled, all the events caused by a user will be deleted upon the user's deletion. Defaults to `true` .
2022-07-02 11:01:40 +00:00
### `AUTHENTIK_DEFAULT_TOKEN_LENGTH`
2022-04-11 18:57:16 +00:00
:::info
Requires authentik 2022.4.1
:::
2022-09-30 21:12:51 +00:00
Configure the length of generated tokens. Defaults to 60.
2022-04-11 18:57:16 +00:00
2022-07-02 11:01:40 +00:00
### `AUTHENTIK_IMPERSONATION`
2022-04-17 14:52:55 +00:00
:::info
Requires authentik 2022.4.2
:::
Globally enable/disable impersonation. Defaults to `true` .
2022-07-02 11:01:40 +00:00
### `AUTHENTIK_FOOTER_LINKS`
2021-11-14 11:28:46 +00:00
:::info
2021-12-18 14:34:39 +00:00
Requires authentik 2021.12.1
2021-11-14 11:28:46 +00:00
:::
This option configures the footer links on the flow executor pages.
The setting can be used as follows:
```
AUTHENTIK_FOOTER_LINKS='[{"name": "Link Name","href":"https://goauthentik.io"}]'
```
2023-01-09 12:13:41 +00:00
### `AUTHENTIK_LDAP__TASK_TIMEOUT_HOURS`
2023-01-06 11:37:59 +00:00
:::info
Requires authentik 2023.1
:::
Timeout in hours for LDAP synchronization tasks.
Defaults to `2` .
2023-07-07 23:15:35 +00:00
### `AUTHENTIK_LDAP__PAGE_SIZE`
:::info
Requires authentik 2023.6.1
:::
Page size for LDAP synchronization. Controls the number of objects created in a single task.
Defaults to `50` .
2022-07-02 11:01:40 +00:00
### `AUTHENTIK_LDAP__TLS__CIPHERS`
2022-07-01 17:53:49 +00:00
:::info
Requires authentik 2022.7
:::
Allows configuration of TLS Cliphers for LDAP connections used by LDAP sources. Setting applies to all sources.
Defaults to `null` .
2022-09-21 07:59:03 +00:00
### `AUTHENTIK_WEB__WORKERS`
2021-11-07 20:39:25 +00:00
2022-09-21 07:59:03 +00:00
:::info
Requires authentik 2022.9
:::
2021-11-07 20:39:25 +00:00
2022-09-21 07:59:03 +00:00
Configure how many gunicorn worker processes should be started (see https://docs.gunicorn.org/en/stable/design.html).
If running in Kubernetes, the default value is set to 2 and should in most cases not be changed, as scaling can be done with multiple pods running the web server.
Otherwise, authentik will use 1 worker for each 4 CPU cores + 1 as a value below 2 workers is not recommended.
### `AUTHENTIK_WEB__THREADS`
:::info
Requires authentik 2022.9
:::
Configure how many gunicorn threads a worker processes should have (see https://docs.gunicorn.org/en/stable/design.html).
Defaults to 4.
2022-12-15 09:49:51 +00:00
## Custom python settings
To modify additional settings further than the options above allow, you can create a custom python file and mount it to `/data/user_settings.py` . This file will be loaded on startup by both the server and the worker. All default settings are [here ](https://github.com/goauthentik/authentik/blob/main/authentik/root/settings.py )
2023-01-13 15:22:03 +00:00
:::caution
2022-12-15 09:49:51 +00:00
Using these custom settings is not supported and can prevent your authentik instance from starting. Use with caution.
:::