Expose Local Android Servers to the Internet with Cloudflare Zero Trust
A native, high-performance wrapper for Cloudflare Tunnel (cloudflared). Paste any command from Cloudflare (Windows, Linux, or Docker) and the app automatically extracts and connects your tunnel without root or port forwarding.
cloudflared.exe service install..., sudo cloudflared..., or Docker commands). The app automatically strips wrappers and extracts the clean token./etc/resolv.conf by piping upstream resolvers (1.1.1.1) directly via //proc/self/fd/0.LOCKED_BOOT_COMPLETED) before unlock.Built for Simplicity & Control
Getting Started in 3 Steps
Create a Tunnel in Cloudflare Zero Trust
Log in to the Cloudflare Zero Trust Dashboard. Go to Networks > Tunnels > Add a tunnel.
Select Cloudflared, enter a name, and under Install and run a connector, copy the command line from any operating system (Windows, Linux, or Docker):
# You can copy the entire command as-is:
cloudflared.exe service install eyJhIjoiMzEyNDZl...
# OR
sudo cloudflared service install eyJhIjoiMzEyNDZl...
# OR
docker run cloudflare/cloudflared tunnel --no-autoupdate run --token eyJh...
Paste into the App
Install cloudflared-android.apk on your device. Open the app and paste what you copied into the Tunnel Token field (or tap the Paste from Clipboard icon).
The app will automatically detect and extract the token, validate its structure, and show a green confirmation badge with your Tunnel ID.
Tap Connect Tunnel, grant Notification Permission, and approve the battery optimization exemption when prompted.
Route Inbound Public Hostname
Back in your Cloudflare dashboard under the Public Hostnames tab, configure a route pointing to your Android local service:
Public Hostname: mydevice.yourdomain.com
Service Type: HTTP
URL: localhost:8080
Traffic to https://mydevice.yourdomain.com is now routed directly and securely to your phone or tablet.
What You Can Build
# In Termux: Launch server
python3 -m http.server 8080
# Mapped via Cloudflare to:
# https://api.yourdomain.com
24/7 Background Execution Guide
Aggressive battery-saving algorithms in custom Android skins can kill background services. Configure your device manufacturer's settings for uninterrupted uptime:
| Manufacturer / OS | Menu Navigation | Required Configuration |
|---|---|---|
| Google Pixel / AOSP | Settings > Apps > Cloudflared > App battery usage | Set to Unrestricted |
| Samsung (One UI) | Settings > Battery > Background usage limits | Add Cloudflared to Never sleeping apps |
| Xiaomi (HyperOS / MIUI) | App Info > Battery saver & Autostart | Select No restrictions and enable Autostart |
| OnePlus / Oppo / Realme | App Info > Battery usage | Enable Allow background activity and Allow auto-launch |
Frequently Asked Questions
Can I paste the entire command from Cloudflare?
Yes. The app features a smart universal input parser. You can paste cloudflared.exe service install <token>, sudo cloudflared service install <token>, Docker commands, or raw tokens. The app will automatically isolate, clean, and validate the token.
Does this application require root access?
No. Cloudflared for Android operates completely within the unprivileged Android application sandbox. It uses custom stdin descriptor redirection to provide DNS resolution natively without superuser rights.
Can I expose services running inside Termux?
Yes. Any web service, API, or socket bound to localhost or 127.0.0.1 in Termux can be accessed by the Cloudflared service and exposed through your public hostname.
How does this bypass CGNAT and mobile carrier firewalls?
Traditional hosting requires an open incoming port, which mobile carriers block via Carrier-Grade NAT (CGNAT). Cloudflared establishes outbound encrypted QUIC/HTTP2 connections to Cloudflare's edge network, completely eliminating the need for inbound ports.
Will this drain my device's battery?
The native engine is lightweight and consumes minimal CPU when idle. When configured with appropriate battery exemptions, it typically consumes under 2-3% of battery over a full 24-hour period.