Running Telegraf as a Windows service

Telegraf natively supports running as a Windows service.

The following commands are available:

Command Effect
telegraf.exe --service install Install telegraf as a service
telegraf.exe --service uninstall Remove the telegraf service
telegraf.exe --service start Start the telegraf service
telegraf.exe --service stop Stop the telegraf service

Outlined below are the general steps to install Telegraf as a Service.

Installing a Windows service requires administrative permissions. Be sure to launch Powershell as administrator.

  1. Download the Telegraf binary and unzip its contents to C:\Program Files\InfluxData\Telegraf.
  2. In PowerShell, run the following as an administrator: powershell > cd "C:\Program Files\InfluxData\Telegraf" > .\telegraf.exe --service install --config "C:\Program Files\InfluxData\Telegraf\telegraf.conf" When installing as service in Windows, always double check to specify full, correct path of the config file. Otherwise the Windows service may fail to start.
  3. To test that the installation works, run:
   > C:\"Program Files"\Telegraf\telegraf.exe --config C:\"Program Files"\Telegraf\telegraf.conf --test
  1. 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 on start, view error logs by selecting Event ViewerWindows LogsApplication.

This documentation is open source. See a typo? Please, open an issue.

Need help getting up and running? Get Support