Argo Tunnel as a service


I’m trying to setup an Argo Tunnel as a service from a MacOS device. I’m running the latest cloudflared version (2021.2.1).

This is the config I’m having:

tunnel: xxxxxxxx-xxxxx-xxxxx-xxxxx-xxxxxxxxxxx
credentials-file: /etc/cloudflared/xxxxxxxx-xxxxx-xxxxx-xxxxx-xxxxxxxxxxx.json

  - hostname:
    service: hello_world
  - service: http_status:404

If I’m running cloudflared tunnel run, the tunnel is setup correctly and without problems.
When I run the tunnel however by cloudflared service install, I get the following error:

Use `cloudflared tunnel run` to start tunnel xxxxxxxx-xxxxx-xxxxx-xxxxx-xxxxxxxxxxx

It’s also very strange as I’ve found that you can also run the tunnel in --legacy mode. This is however the error I’m getting when I’m trying to run it in legacy mode:

$ sudo cloudflared service install --legacy
Incorrect Usage: flag provided but not defined: -legacy

   cloudflared service install - Install Argo Tunnel as an user launch agent

   cloudflared service install [command options] [arguments...]

   --help, -h  show help (default: false)

Any idea how I can solve this?

Thanks a lot in advance!

Hello @Cadish ,

In MacOS, the service installation will create a plist file somewhere in /Users/<USER>/Library/LaunchAgents/com.cloudflare.cloudflared.plist.
If you edit that file, you can properly configure the command used to launch cloudflared. E.g.:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">

And then just do:

launchctl unload /Users/<USER>/Library/LaunchAgents/com.cloudflare.cloudflared.plist

(to stop the currently running cloudflared)


launchctl load /Users/<USER>/Library/LaunchAgents/com.cloudflare.cloudflared.plist

(to load it again)


Thanks a lot @nuno.diegues ! This indeed works now.

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