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, Argo Tunnel 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 need to create a config.yml
file in the etc/cloudflared
directory. The file must contain at least the following arguments:
hostname: tunnel.yourdomain.comurl: https://localhost:8000logfile: /var/log/cloudflared.log
Sometimes firewalls or unusual network configuration can prevent cloudflared
from automatically installing the certificate. If this occurs, your browser will download the certificate as a file named cert.pem
after you login. You should see it in your browser's standard list of downloaded files. You'll need to move that cert.pem
file from your browser's downloads folder into the ~/.cloudflared
folder. Copy and paste the following command to move the certificate to the ~/.cloudflared
directory on your system.
$ mv cert.pem ~/.cloudflared/cert.pem
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>
.
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