Configuration Introduction

    Configuration in Traefik can refer to two different things:

    • The startup configuration (referred to as the static configuration)

    Elements in the static configuration set up connections to providers and define the Traefik will listen to (these elements don’t change often).

    The dynamic configuration contains everything that defines how the requests are handled by your system. This configuration can change and is seamlessly hot-reloaded, without any request interruption or connection loss.

    Incompatible Configuration

    Please be aware that the old configurations for Traefik v1.x are NOT compatible with the v2.x config as of now. If you are running v2, please ensure you are using a v2 configuration.

    Since this configuration is specific to your infrastructure choices, we invite you to refer to the dedicated section of this documentation.

    In the , the dynamic configuration comes from docker in the form of labels attached to your containers.

    HTTPS Certificates also belong to the dynamic configuration.

    You can add / update / remove them without restarting your Traefik instance.

    There are three different, mutually exclusive (i.e. you can use only one at the same time), ways to define static configuration options in Traefik:

    1. In a configuration file
    2. In the command-line arguments
    3. As environment variables

    These ways are evaluated in the order listed above.

    For example, the option is enough by itself to enable the docker provider, even though sub-options like --providers.docker.endpoint exist. Once positioned, this option sets (and resets) all the default values of the sub-options of --providers.docker.

    At startup, Traefik searches for a file named traefik.yml (or traefik.yaml or ) in:

    • /etc/traefik/
    • $XDG_CONFIG_HOME/
    • . (the working directory).

    You can override this using the argument.

    To get the list of all available arguments:

    1. traefik --help
    2. # or

    All available arguments can also be found here.

    All available environment variables can be found

    You can browse the available features in the menu, the providers, or the to see them in action.