Supported tags and respective Dockerfile links

For detailed information about the published artifacts of each of the above supported tags (image metadata, transfer size, etc), please see the repos/telegraf directory in the docker-library/repo-info GitHub repo.

For more information about this image and its history, please see the relevant manifest file (library/telegraf). This image is updated via pull requests to the docker-library/official-images GitHub repo.


Telegraf is an open source agent written in Go for collecting metrics and data on the system it’s running on or from other services. Telegraf writes data it collects to InfluxDB in the correct format.

Telegraf Official Docs

Using this image

Exposed Ports

  • 8125 StatsD
  • 8092 UDP
  • 8094 TCP

Using the default configuration

The default configuration requires a running InfluxDB instance as an output plugin. Ensure that InfluxDB is running on port 8086 before starting the Telegraf container.

Minimal example to start an InfluxDB container:

        $ docker run -d --name influxdb -p 8083:8083 -p 8086:8086 influxdb


Starting Telegraf using the default config, which connects to InfluxDB at http://localhost:8086/:

        $ docker run --net=container:influxdb telegraf


Using a custom config file

First, generate a sample configuration and save it as telegraf.conf on the host:

        $ docker run --rm telegraf -sample-config > telegraf.conf


Once you’ve customized telegraf.conf, you can run the Telegraf container with it mounted in the expected location:

        $ docker run -v $PWD/telegraf.conf:/etc/telegraf/telegraf.conf:ro telegraf


Modify $PWD to the directory where you want to store the configuration file.

Read more about the Telegraf configuration here.

Using the container with input plugins

These examples assume you are using a custom configuration file that takes advantage of Docker’s built-in service discovery capability. In order to do so, we’ll first create a new network:

        $ docker network create influxdb


Next, we’ll start our InfluxDB container named influxdb:

        $ docker run -d --name=influxdb 


The telegraf.conf configuration can now resolve the influxdb container by name:

    urls = [http://influxdb:8086]


Finally, we start our Telegraf container and verify functionality:

        $ docker run -d --name=telegraf 
      -v $PWD/telegraf.conf:/etc/telegraf/telegraf.conf:ro 
$ docker logs -f telegraf



Start an instance of aerospike:

        $ docker run -d --name aerospike 
      -p 3000-3003:3000-3003 


Edit your Telegraf config file and set the correct connection parameter for Aerospike:

    servers = [aerospike:3000]


Restart your telegraf container to pick up the changes:

        $ docker restart telegraf



Create an nginx_status.conf configuration file to expose metric data:

        server {
    listen 8090;
    location /nginx_status {
        stub_status on;
        access_log on;


Start an Nginx container utilizing it:

        $ docker run -d --name=nginx 
      -p 8090:8090 -p 8080:80 
      -v $PWD/nginx_status.conf:/etc/nginx/conf.d/nginx_status.conf:ro 


Verify the status page: http://localhost:8090/nginx_status.

Configure the nginx input plugin in your Telegraf configuration file:

  urls = [http://nginx:8090/nginx_status]


Restart your telegraf container to pick up the changes:

        $ docker restart telegraf



Telegraf has a StatsD plugin, allowing Telegraf to run as a StatsD server that metrics can be sent to. In order for this to work, you must first configure the StatsD plugin in your config file.

Run Telegraf with the UDP port 8125 exposed:

        $ docker run -d --name=telegraf 
      -p 8125:8125/udp 
      -v $PWD/telegraf.conf:/etc/telegraf/telegraf.conf:ro 


Send Mock StatsD data:

        $ for i in {1..50}; do echo $i;echo foo:1|c | nc -u -w0 8125; done


Check that the measurement foo is added in the DB.

Supported Plugins Reference

Image Variants

The telegraf images come in many flavors, each designed for a specific use case.


This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of. This tag is based off of
. buildpack-deps is designed for the average user of docker who has many images on their system. It, by design, has a large number of extremely common Debian packages. This reduces the number of packages that images that derive from it need to install, thus reducing the overall size of all images on your system.


This image is based on the popular Alpine Linux project, available in the alpine official image. Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.

This variant is highly recommended when final image size being as small as possible is desired. The main caveat to note is that it does use musl libc instead of glibc and friends, so certain software might run into issues depending on the depth of their libc requirements. However, most software doesn’t have an issue with this, so this variant is usually a very safe choice. See this Hacker News comment thread for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.

To minimize image size, it’s uncommon for additional related tools (such as git or bash) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the
alpine image description
for examples of how to install packages if you are unfamiliar).


View license information for the software contained in this image.

Supported Docker versions

This image is officially supported on Docker version 17.04.0-ce.

Support for older versions (down to 1.6) is provided on a best-effort basis.

Please see the Docker installation documentation for details on how to upgrade your Docker daemon.

User Feedback


If you have any problems with or questions about this image, please contact us through a GitHub issue. If the issue is related to a CVE, please check for a cve-tracker issue on the official-images repository first.

You can also reach many of the official image maintainers via the #docker-library IRC channel on Freenode.


You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.

Before you start to code, we recommend discussing your plans through a GitHub issue, especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.


Documentation for this image is stored in the
telegraf/ directory
of the
docker-library/docs GitHub repo
. Be sure to familiarize yourself with the repository’s file before attempting a pull request.

Add to wish list
Demo URL
Current Version
Last Update
Date Created
File Format(s)
File size
Compatible Platform
License Type
Support Options
Misc Info
Product Tags
More Questions
Change Log

You must log in and be a buyer of this download to submit a review.


Generic filters
Exact matches only



0 sales

Add to wish list

Download Categories: , ,
Download Tag:

Your Cart


Sign up to stay tuned and receive special offers!

Subscribe to one or more email lists you want to receive:

You May Also Like

Copyright 2019


Sign Up

Enter your email and Password

Log In

Enter your Username or email and password

Reset Password

Enter your email to reset your password

<-- script type="text/javascript">jQuery('#qt_popup_close').on('click', ppppop);