Cloudflare Access can serve applications that run on Windows systems without requiring administrators to open firewall ports to the Internet.
Cloudflare Argo Tunnel
Cloudflare secures servers from direct attack by creating outbound-only connections to the Cloudflare network. Argo Tunnel relies on a lightweight daemon,
cloudflared, that runs in your environment to establish that connection.
Connect the server to Cloudflare
You can connect a Windows server to Cloudflare using Argo Tunnel. Alternatively, a DNS record can point requests to an external IP of the server, but will need to verify the JSON Web Token (JWT) sent by Access to ensure attacks do not connect to an exposed IP directly.
1. Install the Cloudflare daemon on the remote machine
The Cloudflare daemon,
cloudflared, will maintain a secure, persistent, outbound-only connection from the machine to Cloudflare.
cloudflared executable in a location accessible to the OS, for example:
Next, run CMD as an administrator to install the service.
C:\Cloudflared\bin\cloudflared.exe service install
By default, the agent will run as a Local Account service and will look for the configuration and certificate file in the
systemprofile. Run the following command to create a new directory within
2. Authenticate the Cloudflare daemon
Run the following command to authenticate
cloudflared into your Cloudflare account.
cloudflared will open a browser window and prompt you to login to your Cloudflare account. If you are working on a machine that does not have a browser, or a browser window does not launch, you can copy the URL from the command-line output and visit the URL in a browser on any machine.
Once you login, Cloudflare will display the sites that you added to your account. Select the site where you will create a subdomain to represent the remote desktop. For example, if you plan to share the desktop at
site.com from the list. Each remote desktop requires a unique subdomain.
The file will download to the user profile. This must be copied to the
systemprofile directory created previously.
copy C:\Users\%USERNAME%\.cloudflared\cert.pem C:\Windows\System32\config\systemprofile\.cloudflared
cloudflared will download a wildcard certificate for the site. This certificate will allow
cloudflared to create a DNS record for a subdomain of the site.
cloudflared will use a YML file for configuration. Run
Notepad.exe as an administrator. This must be done as an administrator since this file will be saved to the system directory.
hostname: app.site.comurl: localhost:80logfile: C:\Windows\System32\config\systemprofile\.cloudflared\tunnel.log
Save this file to the following location.
- Windows hides extensions, which can sometimes result in a configuration field appending an extra
.txtextension. For example, the
config.ymlfile might be
config.yml.txtaccording to the service. This happens by default when Notepad is used to edit any file. Please ensure this is not present.