CLI

The Traefik Command Line

General

  1. traefik [command] [flags] [arguments]

Use traefik [command] --help for help on any command.

Commands:

  • healthcheck Calls Traefik /ping to check the health of Traefik (the API must be enabled).
  • version Shows the current Traefik version.

Flag's usage:

  1. # set flag_argument to flag(s)
  2. traefik [--flag=flag_argument] [-f [flag_argument]]
  3. # set true/false to boolean flag(s)
  4. traefik [--flag[=true|false| ]] [-f [true|false| ]]

All flags are documented in the (static configuration) CLI reference.

Flags are case insensitive.

healthcheck

Calls Traefik /ping to check the health of Traefik. Its exit status is 0 if Traefik is healthy and 1 otherwise.

This can be used with Docker HEALTHCHECK instruction or any other health check orchestration mechanism.

Info

The ping endpoint must be enabled to allow the healthcheck command to call /ping.

Usage:

  1. traefik healthcheck [command] [flags] [arguments]

Example:

  1. $ traefik healthcheck
  2. OK: http://:8082/ping

version

Shows the current Traefik version.

Usage:

  1. traefik version