Scripts to install, configure and uninstall Cloudflare Tunnels on OpenWrt, for both Raspberry Pi and x86 platforms. Downloads cloudflared directly from GitHub and handles tunnel setup and service configuration.
install-cloudflared.sh– Downloads cloudflared, walks through tunnel setup (local or web-managed), sets up the init.d service, and installs an updater with optional daily cron.uninstall-cloudflared.sh– Removes everything: service, binary, updater, configs, and cron job.
- Raspberry Pi or x86 running OpenWrt 24.10+ (opkg) or 25.12+ (apk)
- Root access
- Internet connection
git clone https://github.com/Coralesoft/OpenwrtCloudflare.git
cd OpenwrtCloudflarechmod +x install-cloudflared.sh && sudo ./install-cloudflared.sh- Download the installer:
wget https://raw.githubusercontent.com/Coralesoft/OpenwrtCloudflare/main/install-cloudflared.sh
- Make it executable:
chmod +x install-cloudflared.sh
- Run it:
sudo ./install-cloudflared.sh
- Follow the prompts – pick local or web-managed, enter your tunnel details, optionally enable daily auto-updates.
chmod +x uninstall-cloudflared.sh && sudo ./uninstall-cloudflared.sh- Download the uninstaller:
wget https://raw.githubusercontent.com/Coralesoft/OpenwrtCloudflare/main/uninstall-cloudflared.sh
- Make it executable:
chmod +x uninstall-cloudflared.sh
- Run it:
sudo ./uninstall-cloudflared.sh
If you enabled the cron job during install, cloudflared is checked daily at 12:30 and updated if a new release is out.
/usr/sbin/cloudflared-update- Not enough space – Installer checks for ~65 MB free and will tell you if there isn't enough.
- Unsupported architecture – Only aarch64 and x86_64 are supported.
- Permission errors – Run as root.
- Install fails halfway through – The installer rolls back automatically.
For issues or feature requests, contact C. Brown at dev@coralesoft.nz.
If you find this useful, consider buying me a coffee:
MIT License – see LICENSE for details.
Thanks to the OpenWrt and Cloudflare communities for their tools and documentation.