Geekflare is supported by our audience. We may earn affiliate commissions from buying links on this site.
In Security Last updated: February 9, 2020
Share on:
Invicti Web Application Security Scanner – the only solution that delivers automatic verification of vulnerabilities with Proof-Based Scanning™.

Don’t let someone bypass Cloudflare protection and misuse your origin server!

Cloudflare is one of the popular CDN and security platform, powering millions of sites from small to enterprise. When you implement Cloudflare for your website, all the traffic is secured and accelerated. But this is true when a site is accessed using a domain name. How about if someone finds out the actual server IP (Origin) and misuse it?

Finding server IP for the site behind Cloudflare doesn’t take much. You can find out how, as explained here and here. You see, just implementing CDN and Cloud-based WAF is not enough. You should also consider protecting origin.

So, what’s the solution?

Argo Tunnel – a smart solution by Cloudflare to protect the origin server from direct attack.

It is a daemon that you need to install on your server that creates an encrypted tunnel between server to Cloudflare network. There is zero complicated ACL/IP table configuration.

The good news is you don’t need to be under PRO or higher plan. You can get it started even you are under the FREE plan. All you pay is for Argo subscription, which starts from $5 per month.

Let’s get it started with installation and setup.

Installing Cloudflare daemon

  • Login to the origin server with root or sudo privilege
  • Download the latest stable package. I am on Ubuntu so, .deb file for other OS, check out the official download page.
  • Install the downloaded package
dpkg -i cloudflared-stable-linux-amd64.deb
  • Let’s verify the version to ensure it has installed
root@gf-prod:~# cloudflared --version
cloudflared version 2020.2.0 (built 2020-02-07-1653 UTC)


Authenticate Daemon

Next would be to authenticate to Cloudflare using the daemon. Run the below command

cloudflared tunnel login
  • It will prompt you the URL which you can use to login to Cloudflare and authorize the site.
root@gf-prod:~# cloudflared tunnel login
Please open the following URL and log in with your Cloudflare account:

Leave cloudflared running to download the cert automatically.
INFO[0030] Waiting for login...                         
INFO[0060] Waiting for login...                         
INFO[0090] Waiting for login...                         
INFO[0120] Waiting for login...                         
You have successfully logged in.
If you wish to copy your credentials to a server, they have been saved to:
  • Once authorized, you should see something like this.

Starting the tunnel

Let’s start the tunneling below.

cloudflared tunnel --hostname [HOSTNAME] http://localhost:80


root@gf-prod:~# cloudflared tunnel --hostname
WARN[0000] Cannot determine default configuration path. No file [config.yml config.yaml] in [~/.cloudflared ~/.cloudflare-warp ~/cloudflare-warp /usr/local/etc/cloudflared /etc/cloudflared] 
INFO[0000] Version 2020.2.0                             
INFO[0000] GOOS: linux, GOVersion: go1.12.7, GoArch: amd64 
INFO[0000] Flags                                proxy-dns-upstream=","
INFO[0000] cloudflared will not automatically update when run from the shell. To enable auto-updates, run cloudflared as a service: 
INFO[0000] Starting metrics server                       addr=""
INFO[0000] Proxying tunnel requests to 
INFO[0000] Connected to LAX                              connectionID=0
INFO[0001] Each HA connection's tunnel IDs: map[0:xxx]  connectionID=0
INFO[0001] Route propagating, it may take up to 1 minute for your new route to become functional  connectionID=0
INFO[0003] Connected to LAX

Congratulations! origin is locked down now. Try to access your website using origin IP, and you should see the “connection refused” message.

Starting Argo Tunnel at Boot

Let’s ensure the Argo Tunnel is started when the server reboot. Run the below command on the server.

cloudflared service install


Cloudflare Argo Tunnel looks promising. Just in around 30 minutes, you can protect the origin server.

  • Chandan Kumar
    As the founder of Geekflare, I’ve helped millions to excel in the digital realm. Passionate about technology, I’m on a mission to explore the world and amplify growth for professionals and businesses alike.
Thanks to our Sponsors
More great readings on Security
Power Your Business
Some of the tools and services to help your business grow.
  • Invicti uses the Proof-Based Scanning™ to automatically verify the identified vulnerabilities and generate actionable results within just hours.
    Try Invicti
  • Web scraping, residential proxy, proxy manager, web unlocker, search engine crawler, and all you need to collect web data.
    Try Brightdata
  • is an all-in-one work OS to help you manage projects, tasks, work, sales, CRM, operations, workflows, and more.
    Try Monday
  • Intruder is an online vulnerability scanner that finds cyber security weaknesses in your infrastructure, to avoid costly data breaches.
    Try Intruder