Documentation

Install Telegraf

This page documents an earlier version of Telegraf. Telegraf v1.24 is the latest stable version. View this page in the v1.24 documentation.

This page provides directions for installing, starting, and configuring Telegraf. To install Telegraf, do the following:

  1. Download Telegraf
  2. Review requirements
  3. Complete the installation

Download

Download the latest Telegraf release at the InfluxData download page.

Requirements

Installation of the Telegraf package may require root or administrator privileges in order to complete successfully.

Networking

Telegraf offers multiple service input plugins that may require custom ports. Modify port mappings through the configuration file (telegraf.conf).

For Linux distributions, this file is located at /etc/telegraf for default installations.

For Windows distributions, the configuration file is located in the directory where you unzipped the Telegraf ZIP archive. The default location is C:\InfluxData\telegraf.

NTP

Telegraf uses a host’s local time in UTC to assign timestamps to data. Use the Network Time Protocol (NTP) to synchronize time between hosts. If hosts’ clocks aren’t synchronized with NTP, the timestamps on the data might be inaccurate.

Installation

Debian and Ubuntu users can install the latest stable version of Telegraf using the apt-get package manager.

Ubuntu & Debian

Install Telegraf from the InfluxData repository with the following commands:

wget -qO- https://repos.influxdata.com/influxdb.key | sudo tee /etc/apt/trusted.gpg.d/influxdb.asc >/dev/null
echo "deb https://repos.influxdata.com/debian stable main" | sudo tee /etc/apt/sources.list.d/influxdb.list
sudo apt-get update && sudo apt-get install telegraf
curl -s https://repos.influxdata.com/influxdb.key | sudo tee /etc/apt/trusted.gpg.d/influxdb.asc >/dev/null
echo "deb https://repos.influxdata.com/debian stable main" | sudo tee /etc/apt/sources.list.d/influxdb.list
sudo apt-get update && sudo apt-get install telegraf

Install from a .deb file:

To manually install the Debian package from a .deb file:

  1. Download the latest Telegraf .deb release from the Telegraf section of the downloads page.

  2. Run the following command (making sure to supply the correct version number for the downloaded file):

    sudo dpkg -i telegraf_1.22.2-1_amd64.deb
    

Verify the authenticity of downloaded binary (optional)

InfluxData cryptographically signs each Telegraf binary release. For added security, follow these steps to verify the signature of your download with gpg.

(Most operating systems include the gpg command by default. If gpg is not available, see the GnuPG homepage for installation instructions.)

  1. Download and import InfluxData’s public key:

    curl -sL https://repos.influxdata.com/influxdb.key | gpg --import
    
  2. Download the signature file for the release by adding .asc to the download URL. For example:

    wget https://dl.influxdata.com/telegraf/releases/telegraf-1.22.2_linux_amd64.tar.gz.asc
    
  3. Verify the signature with gpg --verify:

    gpg --verify telegraf-1.22.2_linux_amd64.tar.gz.asc telegraf-1.22.2_linux_amd64.tar.gz
    

    The output from this command should include the following:

    gpg: Good signature from "InfluxDB Packaging Service <support@influxdb.com>" [unknown]
    

Configuration

Create a configuration file with default input and output plugins.

Every plugin will be in the file, but most will be commented out.

telegraf config > telegraf.conf

Create a configuration file with specific inputs and outputs

telegraf --input-filter <pluginname>[:<pluginname>] --output-filter <outputname>[:<outputname>] config > telegraf.conf

For more advanced configuration details, see the configuration documentation.

For instructions on how to manually install the RPM package from a file, please see the downloads page.

RedHat and CentOS: Install the latest stable version of Telegraf using the yum package manager:

cat <<EOF | sudo tee /etc/yum.repos.d/influxdb.repo
[influxdb]
name = InfluxData Repository - Stable
baseurl = https://repos.influxdata.com/stable/\$basearch/main
enabled = 1
gpgcheck = 1
gpgkey = https://repos.influxdata.com/influxdb.key
EOF

Install telegraf once the repository is added to the yum configuration:

sudo yum install telegraf

Verify the authenticity of downloaded binary (optional)

InfluxData cryptographically signs each Telegraf binary release. For added security, follow these steps to verify the signature of your download with gpg.

(Most operating systems include the gpg command by default. If gpg is not available, see the GnuPG homepage for installation instructions.)

  1. Download and import InfluxData’s public key:

    curl -sL https://repos.influxdata.com/influxdb.key | gpg --import
    
  2. Download the signature file for the release by adding .asc to the download URL. For example:

    wget https://dl.influxdata.com/telegraf/releases/telegraf-1.22.2_linux_amd64.tar.gz.asc
    
  3. Verify the signature with gpg --verify:

    gpg --verify telegraf-1.22.2_linux_amd64.tar.gz.asc telegraf-1.22.2_linux_amd64.tar.gz
    

    The output from this command should include the following:

    gpg: Good signature from "InfluxDB Packaging Service <support@influxdb.com>" [unknown]
    

Configuration

Create a configuration file with default input and output plugins

Every plugin will be in the file, but most will be commented out.

telegraf config > telegraf.conf

Create a configuration file with specific inputs and outputs

telegraf --input-filter <pluginname>[:<pluginname>] --output-filter <outputname>[:<outputname>] config > telegraf.conf

For more advanced configuration details, see the configuration documentation.

There are RPM packages provided by openSUSE Build Service for SUSE Linux users:

# add go repository
zypper ar -f obs://devel:languages:go/ go
# install latest telegraf
zypper in telegraf

Verify the authenticity of downloaded binary (optional)

InfluxData cryptographically signs each Telegraf binary release. For added security, follow these steps to verify the signature of your download with gpg.

(Most operating systems include the gpg command by default. If gpg is not available, see the GnuPG homepage for installation instructions.)

  1. Download and import InfluxData’s public key:

    curl -sL https://repos.influxdata.com/influxdb.key | gpg --import
    
  2. Download the signature file for the release by adding .asc to the download URL. For example:

    wget https://dl.influxdata.com/telegraf/releases/telegraf-1.22.2_linux_amd64.tar.gz.asc
    
  3. Verify the signature with gpg --verify:

    gpg --verify telegraf-1.22.2_linux_amd64.tar.gz.asc telegraf-1.22.2_linux_amd64.tar.gz
    

    The output from this command should include the following:

    gpg: Good signature from "InfluxDB Packaging Service <support@influxdb.com>" [unknown]
    

Configuration

Create a configuration file with default input and output plugins.

Every plugin will be in the file, but most will be commented out.

telegraf config > telegraf.conf

Create a configuration file with specific inputs and outputs

telegraf --input-filter <pluginname>[:<pluginname>] --output-filter <outputname>[:<outputname>] config > telegraf.conf

For more advanced configuration details, see the configuration documentation.

Telegraf is part of the FreeBSD package system. It can be installed by running:

sudo pkg install telegraf

The configuration file is located at /usr/local/etc/telegraf.conf with examples in /usr/local/etc/telegraf.conf.sample.

Verify the authenticity of downloaded binary (optional)

InfluxData cryptographically signs each Telegraf binary release. For added security, follow these steps to verify the signature of your download with gpg.

(Most operating systems include the gpg command by default. If gpg is not available, see the GnuPG homepage for installation instructions.)

  1. Download and import InfluxData’s public key:

    curl -sL https://repos.influxdata.com/influxdb.key | gpg --import
    
  2. Download the signature file for the release by adding .asc to the download URL. For example:

    wget https://dl.influxdata.com/telegraf/releases/telegraf-1.22.2_linux_amd64.tar.gz.asc
    
  3. Verify the signature with gpg --verify:

    gpg --verify telegraf-1.22.2_linux_amd64.tar.gz.asc telegraf-1.22.2_linux_amd64.tar.gz
    

    The output from this command should include the following:

    gpg: Good signature from "InfluxDB Packaging Service <support@influxdb.com>" [unknown]
    

Configuration

Create a configuration file with default input and output plugins.

Every plugin will be in the file, but most will be commented out.

telegraf config > telegraf.conf

Create a configuration file with specific inputs and outputs

telegraf --input-filter <pluginname>[:<pluginname>] --output-filter <outputname>[:<outputname>] config > telegraf.conf

For more advanced configuration details, see the configuration documentation.

Users of macOS 10.8 and higher can install Telegraf using the Homebrew package manager. Once brew is installed, you can install Telegraf by running:

brew update
brew install telegraf

To have launchd start telegraf at next login:

ln -sfv /usr/local/opt/telegraf/*.plist ~/Library/LaunchAgents

To load telegraf now:

launchctl load ~/Library/LaunchAgents/homebrew.mxcl.telegraf.plist

Or, if you don’t want/need launchctl, you can just run:

telegraf -config /usr/local/etc/telegraf.conf

Verify the authenticity of downloaded binary (optional)

InfluxData cryptographically signs each Telegraf binary release. For added security, follow these steps to verify the signature of your download with gpg.

(Most operating systems include the gpg command by default. If gpg is not available, see the GnuPG homepage for installation instructions.)

  1. Download and import InfluxData’s public key:

    curl -sL https://repos.influxdata.com/influxdb.key | gpg --import
    
  2. Download the signature file for the release by adding .asc to the download URL. For example:

    wget https://dl.influxdata.com/telegraf/releases/telegraf-1.22.2_linux_amd64.tar.gz.asc
    
  3. Verify the signature with gpg --verify:

    gpg --verify telegraf-1.22.2_linux_amd64.tar.gz.asc telegraf-1.22.2_linux_amd64.tar.gz
    

    The output from this command should include the following:

    gpg: Good signature from "InfluxDB Packaging Service <support@influxdb.com>" [unknown]
    

Configuration

Create a configuration file with default input and output plugins.

Every plugin will be in the file, but most will be commented out.

telegraf config > telegraf.conf

Create a configuration file with specific inputs and outputs

telegraf --input-filter <pluginname>[:<pluginname>] --output-filter <outputname>[:<outputname>] config > telegraf.conf

For more advanced configuration details, see the configuration documentation.

Download and run Telegraf as a Windows service

Installing a Windows service requires administrative permissions. To run PowerShell as an administrator, see Launch PowerShell as administrator.

In PowerShell as an administrator, do the following:

  1. Use the following commands to download the Telegraf Windows binary and extract its contents to C:\Program Files\InfluxData\telegraf\:

    > wget https://dl.influxdata.com/telegraf/releases/telegraf-1.22.2_windows_amd64.zip -UseBasicParsing -OutFile telegraf-1.22.2_windows_amd64.zip
    > Expand-Archive .\telegraf-1.22.2_windows_amd64.zip -DestinationPath 'C:\Program Files\InfluxData\telegraf\'
    
  2. Move the telegraf.exe and telegraf.conf files from C:\Program Files\InfluxData\telegraf\telegraf-1.22.2 up a level to C:\Program Files\InfluxData\telegraf:

    > cd "C:\Program Files\InfluxData\telegraf"
    > mv .\telegraf-1.22.2\telegraf.* .
    

    Or create a Windows symbolic link (Symlink) to point to this directory.

    The instructions below assume that either the telegraf.exe and telegraf.conf files are stored in C:\Program Files\InfluxData\telegraf, or you’ve created a Symlink to point to this directory.

  3. Install Telegraf as a service:

    > .\telegraf.exe --service install --config "C:\Program Files\InfluxData\telegraf\telegraf.conf"
    

    Make sure to provide the absolute path of the telegraf.conf configuration file, otherwise the Windows service may fail to start.

  4. To test that the installation works, run:

    > C:\"Program Files"\InfluxData\telegraf\telegraf.exe --config C:\"Program Files"\InfluxData\telegraf\telegraf.conf --test
    
  5. To start collecting data, run:

    telegraf.exe --service start
    

Logging and troubleshooting

When Telegraf runs as a Windows service, Telegraf logs messages to Windows event logs. If the Telegraf service fails to start, view error logs by selecting Event ViewerWindows LogsApplication.

Windows service commands

The following commands are available:

CommandEffect
telegraf.exe --service installInstall telegraf as a service
telegraf.exe --service uninstallRemove the telegraf service
telegraf.exe --service startStart the telegraf service
telegraf.exe --service stopStop the telegraf service

Was this page helpful?

Thank you for your feedback!


Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.