Telegraf is not automatically starting after reboot

Hello,

I have installed influxdb and telegraf in a proxmox lxc container (system: debian 13). I use http-input to collect data from an my api.

I generated a new API token (under influxdb load data ), I start Telegraf with the command: telegraf --config http://xxx.xxx.xxx.xxx:8086/api/v2/telegrafs/1069591a04a65000 in the console.

In the data explorer I can see the data is written to my bucket within influxdb.

After I reboot the lxc container telegraf is not starting automatically.

command “journalctl --no-pager -u telegraf” shows following messages:

Mar 17 08:03:11 lxc-INFLUXDB systemd[1]: Starting telegraf.service - Telegraf…
Mar 17 08:03:12 lxc-INFLUXDB (telegraf)[93]: telegraf.service: Referenced but unset environment variable evaluates to an empty string: TELEGRAF_OPTS
Mar 17 08:03:14 lxc-INFLUXDB telegraf[93]: 2026-03-17T08:03:14Z W! Strict environment variable handling is the new default starting with v1.38.0! If your configuration does not work with strict handling please explicitly add the --non-strict-env-handling flag to switch to the previous behavior!
Mar 17 08:03:14 lxc-INFLUXDB telegraf[93]: 2026-03-17T08:03:14Z I! Loading config: /etc/telegraf/telegraf.conf
Mar 17 08:03:14 lxc-INFLUXDB telegraf[93]: 2026-03-17T08:03:14Z E! [telegraf] Error running agent: no outputs found, probably invalid config file provided
Mar 17 08:03:14 lxc-INFLUXDB systemd[1]: telegraf.service: Main process exited, code=exited, status=1/FAILURE
Mar 17 08:03:14 lxc-INFLUXDB systemd[1]: telegraf.service: Failed with result ‘exit-code’.
Mar 17 08:03:14 lxc-INFLUXDB systemd[1]: Failed to start telegraf.service - Telegraf.
Mar 17 08:03:14 lxc-INFLUXDB systemd[1]: telegraf.service: Consumed 315ms CPU time, 163.7M memory peak.
Mar 17 08:03:14 lxc-INFLUXDB systemd[1]: telegraf.service: Scheduled restart job, restart counter is at 1.

I don’t know how to solve the problem.

Please can you help.

For Telegraf to start on reboot, you’ll need to run it as a background service. telegraf –-config <path> starts it in the foreground in whatever terminal window you’re running it in, so it won’t persist across reboots.

The recommendation from the documentation is to find the default telegraf configuration file location (/etc/telegraf/telegraf.conf), set your Telegraf config there, and then run systemctl start telegraf, which should run it as a Linux service.

You could also create a systemd service file that invokes your config file wherever it is.