Cloudflare Tunnels on Raspberry Pi running OpenWrt

Hi,
I'm not sure if this is the right place to post this but here we go :slight_smile:
I've created an install / uninstall script to setup a Cloudflare tunnel on an Rasberry Pi4 running as a OpenWrt router

I am going to start on a Luci app to make this easier to create and maintain Cloudflare tunnels

Please let me know if you find this useful or any changes

This script will quickly complete a full install of Cloudflare tunnel onto a Raspberry Pi running OpenWrt
The script pulls down the latest version of cloudflared and installs it

  • sets up the service to run it
  • creates the required config in the cloudflare console and system files
  • sets up the service to check for new updates daily

Prerequisite:

  • You have a active cloudflare account
  • You have a domain with DNS managed via cloudflare
  • you are logged into the cloudflare web console (time saver)
2 Likes

You should ask for a wiki account and add it there as well

1 Like

Had some great feedback (thanks) and made some updates

Hi all
I updated the project to support cloudflare tunnels on Openwrt-x86

3 Likes

Hey all,
After an enhancement request, have added support for Web Managed Tunnels so the install now supports both methods

1 Like

Thank you,

With this method If there is a new version for cloudflared I will get updated in /cgi-bin/luci/admin/system/opkg /updates ?

the install script manages the cloudflared agent updating automatically.

hope this helps?

1 Like

You can install the Cloudflared with opkg https://github.com/Coralesoft/OpenwrtCloudflare/pull/18

@tmomas could you please update the wiki page that you created https://openwrt.org/docs/guide-user/services/vpn/cloudfare_tunnel

I recently had the opportunity to briefly review the installation process of Cloudflared using opkg. I observed that it mandates a specific yaml path and creates an init.d script confined to this path, along with other configurations which seem rather restrictive.

In contrast, my method seems to be more versatile and comprehensive, providing users with the option to configure using either approach. Additionally, I've found that managing these tunnels through the Cloudflare dashboard is generally more effective, as it allows for online configuration adjustments. It's noteworthy that Cloudflare offers a one-way conversion from Yaml to Console management, which is quite telling in itself. :slightly_smiling_face:

1 Like