2022-04-15 13:44:08 +00:00
|
|
|
---
|
|
|
|
title: "Traefik CLI Documentation"
|
|
|
|
description: "Learn the basics of the Traefik Proxy command line interface (CLI). Read the technical documentation."
|
|
|
|
---
|
|
|
|
|
2019-02-26 13:50:07 +00:00
|
|
|
# CLI
|
|
|
|
|
|
|
|
The Traefik Command Line
|
|
|
|
{: .subtitle }
|
|
|
|
|
|
|
|
## General
|
|
|
|
|
|
|
|
```bash
|
2019-06-17 09:48:05 +00:00
|
|
|
traefik [command] [flags] [arguments]
|
2019-02-26 13:50:07 +00:00
|
|
|
```
|
|
|
|
|
2019-06-17 09:48:05 +00:00
|
|
|
Use `traefik [command] --help` for help on any command.
|
2019-02-26 13:50:07 +00:00
|
|
|
|
2019-06-17 09:48:05 +00:00
|
|
|
Commands:
|
2019-02-26 13:50:07 +00:00
|
|
|
|
2019-06-17 09:48:05 +00:00
|
|
|
- `healthcheck` Calls Traefik `/ping` to check the health of Traefik (the API must be enabled).
|
|
|
|
- `version` Shows the current Traefik version.
|
2019-02-26 13:50:07 +00:00
|
|
|
|
2019-06-17 09:48:05 +00:00
|
|
|
Flag's usage:
|
2019-02-26 13:50:07 +00:00
|
|
|
|
|
|
|
```bash
|
2019-06-17 09:48:05 +00:00
|
|
|
# set flag_argument to flag(s)
|
|
|
|
traefik [--flag=flag_argument] [-f [flag_argument]]
|
2019-02-26 13:50:07 +00:00
|
|
|
|
2019-06-17 09:48:05 +00:00
|
|
|
# set true/false to boolean flag(s)
|
|
|
|
traefik [--flag[=true|false| ]] [-f [true|false| ]]
|
2019-02-26 13:50:07 +00:00
|
|
|
```
|
|
|
|
|
2019-09-23 12:32:04 +00:00
|
|
|
All flags are documented in the [(static configuration) CLI reference](../reference/static-configuration/cli.md).
|
|
|
|
|
2024-09-13 09:40:04 +00:00
|
|
|
!!! info "Flags are case-insensitive."
|
2019-09-20 15:16:05 +00:00
|
|
|
|
2019-06-21 07:24:04 +00:00
|
|
|
### `healthcheck`
|
2019-02-26 13:50:07 +00:00
|
|
|
|
2019-06-17 09:48:05 +00:00
|
|
|
Calls Traefik `/ping` to check the health of Traefik.
|
|
|
|
Its exit status is `0` if Traefik is healthy and `1` otherwise.
|
2019-02-26 13:50:07 +00:00
|
|
|
|
2019-06-17 09:48:05 +00:00
|
|
|
This can be used with Docker [HEALTHCHECK](https://docs.docker.com/engine/reference/builder/#healthcheck) instruction
|
|
|
|
or any other health check orchestration mechanism.
|
2019-02-26 13:50:07 +00:00
|
|
|
|
2019-09-23 12:32:04 +00:00
|
|
|
!!! info
|
|
|
|
The [`ping` endpoint](../operations/ping.md) must be enabled to allow the `healthcheck` command to call `/ping`.
|
2019-02-26 13:50:07 +00:00
|
|
|
|
2019-06-17 09:48:05 +00:00
|
|
|
Usage:
|
|
|
|
|
2019-02-26 13:50:07 +00:00
|
|
|
```bash
|
2019-06-17 09:48:05 +00:00
|
|
|
traefik healthcheck [command] [flags] [arguments]
|
2019-02-26 13:50:07 +00:00
|
|
|
```
|
|
|
|
|
2019-06-17 09:48:05 +00:00
|
|
|
Example:
|
|
|
|
|
2019-02-26 13:50:07 +00:00
|
|
|
```bash
|
2019-06-17 09:48:05 +00:00
|
|
|
$ traefik healthcheck
|
2019-02-26 13:50:07 +00:00
|
|
|
OK: http://:8082/ping
|
|
|
|
```
|
2019-06-17 09:48:05 +00:00
|
|
|
|
2019-06-21 07:24:04 +00:00
|
|
|
### `version`
|
2019-06-17 09:48:05 +00:00
|
|
|
|
|
|
|
Shows the current Traefik version.
|
|
|
|
|
|
|
|
Usage:
|
|
|
|
|
|
|
|
```bash
|
2019-06-21 07:24:04 +00:00
|
|
|
traefik version
|
2019-06-17 09:48:05 +00:00
|
|
|
```
|