Documentation

Running Telegraf as a Windows service

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

Running Telegraf as a Windows service

Telegraf natively supports running as a Windows service. Outlined below are the general steps to set it up.

  1. Obtain the Telegraf distribution for Windows.

  2. Create the directory C:\Program Files\Telegraf (if you install in a different location, specify the -config parameter with the desired location)

  3. Place the telegraf.exe and the telegraf.conf files into C:\Program Files\Telegraf.

  4. To install the service into the Windows Service Manager, run the following in PowerShell as an administrator. If necessary, you can wrap any spaces in the file directories in double quotes "<file directory>":

    > C:\"Program Files"\Telegraf\telegraf.exe --service install
    
  5. Edit the configuration file to meet your requirements.

  6. To verify that it works, run:

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

    > net start telegraf
    

Other supported operations

Telegraf can manage its own service through the --service flag:

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!


Introducing InfluxDB 3.0

The new core of InfluxDB built with Rust and Apache Arrow. Available today in InfluxDB Cloud Dedicated.

Learn more

State of the InfluxDB Cloud Serverless documentation

The new documentation for InfluxDB Cloud Serverless 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.