Cloudflared For Ubuntu

Download Cloudflared

1
wget -q https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb && dpkg -i cloudflared-linux-amd64.deb

Authenticate Cloudflared

1
cloudflared tunnel login

Create a tunnel and give it a name

1
cloudflared tunnel create <NAME>

Create a configuration file

1
2
3
4
cd /root/.cloudflared

vim config.yml

config.yml

1
2
3
4
5
6
7
8
9

tunnel: <Tunnel-UUID>
credentials-file: /root/.cloudflared/<Tunnel-UUID>.json

ingrss
- hostname: xxx.yourdomin.com
service: http://yourserver:port
- service: http_status:404

Start routing traffic

1
cloudflared tunnel route dns <NAME> <hostname>

Run the tunnel

1
cloudflared tunnel run <NAME>

Check the tunnel

1
cloudflared tunnel info

Run cloudflared as a service

1
2
3
4
5
cloudflared service install

systemctl start cloudflared

systemctl status cloudflared

Reference

Cloudflared Zero Trust: https://developers.cloudflare.com/cloudflare-one/setup