Run Telegraf as a Windows service

This page documents an earlier version of Telegraf. Telegraf v1.26 is the latest stable version.

Telegraf natively supports running as a Windows service.

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 -UseBasicParsing -OutFile
    > Expand-Archive .\ -DestinationPath 'C:\Program Files\InfluxData\telegraf\'
  2. Move the telegraf.exe and telegraf.conf files from C:\Program Files\InfluxData\telegraf\telegraf-1.18.3 up a level to C:\Program Files\InfluxData\telegraf:

    > cd "C:\Program Files\InfluxData\telegraf"
    > mv .\telegraf-1.18.3\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:

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!

Linux Package Signing Key Rotation

All signed InfluxData Linux packages have been resigned with an updated key. If using Linux, you may need to update your package configuration to continue to download and verify InfluxData software packages.

For more information, see the Linux Package Signing Key Rotation blog post.

State of the InfluxDB Cloud (IOx) documentation

The new documentation for InfluxDB Cloud backed by InfluxDB IOx is a work in progress. We are adding new information and content almost daily. Thank you for your patience!

If there is specific information you’re looking for, please submit a documentation issue.