Windows Service tunnel down & won’t stop gracefully


I’ve followed the instructions for configuring cloudflared to run as a sevice here.
Everything was going fine until around Step 14 when it said to modify the Image Path Registry entry to point to both the executable and the config file. I wasn’t sure how to do this, so I just put in the path to cloudflared.exe and then ran the suggested code below:

C:\Cloudflared\bin\cloudflared.exe --config=C:\Users\%USERNAME%\.cloudflared\config.yml tunnel run

That seemed to work ok, but I realised this was in a Cmd session and therefore wasn’t really operating as a service, so I hit Ctl-C and then did the suggested:

sc start cloudflared

That seemed to work, however, when I checked the tunnel, it was Down. When I tried to restart the Cloudflare service, it wouldn’t stop properly and I have to restart the machine to get it to restart. I now have the Image Path registry entry for the service as follows as it is the only config that seems to work after trying multiple ways to put in both the .exe and config.yml paths in there.


I have tried to put in the config file as a parameter to the service, but that does not seem to “take”. At the moment, the service is running, but the tunnel is down. Can anyone help with this please?

Never mind - I see what I did wrong. That “suggested code” I ran was meant to be the registry entry. I just had to instantiate the %USERNAME% variable to make it work. The tunnel is up. Hope this helps someone as it wasn’t exactly clear to me what I was doing wrong.


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.