Automatically Starting Argo Tunnel

Argo Tunnel can install itself as a system service on Linux and Windows and as a launch agent on macOS.

By default, it expects all of the configuration to exist in the cloudflared/config.yml configuration file. The available options are documented on the configuration file reference, but at a minimum you should set hostname and url.

Linux

Run the following command:

$ sudo cloudflared service install

If you have already logged in and have a certificate and (optionally) configuration file in ~/.cloudflared/, these will be copied to /etc/cloudflared/. If you do not have a configuration file, you will be prompted for the minimum required information to set up a tunnel, such as the hostname to use.

macOS

To run at login, open a Terminal and run the following command:

$ cloudflared service install

Argo Tunnel will be installed as a launch agent, and start whenever you log in, using your local user configuration found in ~/.cloudflared/.

You can manually start the service by running:

$ launchctl start com.cloudflare.cloudflared

Output will be logged to ~/Library/Logs/com.cloudflare.cloudflared.err.log and ~/Library/Logs/com.cloudflare.cloudflared.out.log.

If you wish to run at boot, open a Terminal and run the following command:

$ sudo cloudflared service install

Argo Tunnel will be installed as a launch daemon, and start whenever your system boots, using your configuration found in /etc/cloudflared.

You can manually start the service by running:

$ sudo launchctl start com.cloudflare.cloudflared

Output will be logged to /Library/Logs/com.cloudflare.cloudflared.err.log and /Library/Logs/com.cloudflare.cloudflared.out.log.

Windows

Open a Command Prompt with Administrator privileges, then type the following command:

PS C:\Cloudflared> .\cloudflared.exe service install

When running as a service, Argo Tunnel expects its configuration at C:\Windows\system32\config\systemprofile\.cloudflared\config.yml (assuming Windows is installed to C:). You can copy your local configuration from %UserProfile%\.cloudflared\config.yml.

If you need to specify a custom config file location, you can do so in the the Windows registry after the service has been installed (MSDN reference). Open regedit, go to the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Cloudflared, and edit the ImagePath value to include --config <path-to-config>.

When running cloudflared as a service on Windows, the certificate path needs to be explicitly specified. This can be done in the config file:

origincert: C:\ABSOLUTE\PATH\TO\cert.pem

Cloudflared will set up Recovery Properties of the service so it restarts on failure.

This feature is not fully supported on Windows Server 2003 and Windows XP.

Cloudflared does not support loading the system certificate pool in Windows. To supply a certificate pool to Cloudflared in Windows, encode the pool into a PEM file and supply it through the --origin-ca-pool flag.

To start the service, go to Service Manager and start the Argo Tunnel agent service, or run the following command:

C:\> sc start cloudflared
If you are a Powershell user, run this command instead:
PS C:> Start-Service cloudflared