-
-
Notifications
You must be signed in to change notification settings - Fork 1
Cloudflare Tunnel Setup
Expose your media services securely to the internet without opening ports, using Cloudflare Tunnel.
Cloudflare Tunnel creates an encrypted connection from your server to Cloudflare's edge network, allowing external access without exposing ports to the internet.
| Feature | Description |
|---|---|
| π No Port Forwarding | No inbound firewall rules needed |
| π Global CDN | Cloudflare's worldwide network |
| π‘οΈ DDoS Protection | Built-in protection |
| π§ Email Auth | Optional Cloudflare Access protection |
| π Zero Trust | Verify before connecting |
- Cloudflare Account - Sign up free
- Domain on Cloudflare - DNS managed by Cloudflare
- API Token - With required permissions
| Permission | Scope | Purpose |
|---|---|---|
Account:Account Settings:Read |
All Accounts | Read account info |
Account:Cloudflare Tunnel:Edit |
All Accounts | Create/manage tunnels |
Zone:DNS:Edit |
All Zones | Create DNS records |
Account:Zero Trust:Edit |
All Accounts | VPN & Device Setup |
Account:Access: Apps and Policies:Edit |
All Accounts | Emails & Policies |
- Go to Cloudflare API Tokens
- Click Create Token
- Click Create Custom Token
- Configure permissions as above
- Click Continue to summary β Create Token
- Copy the token (shown only once!)
easiarr provides a fully automated Cloudflare Tunnel setup wizard.
-
Run easiarr:
bunx @muhammedaksam/easiarr
-
From the main menu, select:
βοΈ Cloudflare Tunnel -
Paste your API token when prompted
- β Verifies token permissions
- β Fetches your Cloudflare zones (domains)
- β
Creates a new tunnel named
easiarr-{domain} - β Configures ingress rules for all enabled apps
- β Creates DNS CNAME records for each app
- β Configures Zero Trust VPN (optional private network access)
- β Sets up Device Enrollment (if email provided)
- β Optionally sets up Cloudflare Access with email authentication
- β
Saves tunnel token to
.env - β Adds cloudflared to your Docker Compose
easiarr enables you to access your entire private network securely from anywhere using the Cloudflare WARP client, without exposing any ports.
-
Tunnel Route: easiarr adds a private network route (e.g.,
192.168.1.0/24) to your tunnel. - Device Enrollment: easiarr creates a policy allowing you to enroll your devices into your Zero Trust organization.
- WARP Client: You connect via the WARP client on your phone/laptop.
-
Result: You can access local IPs (e.g.,
http://192.168.1.50:8080) directly from anywhere, as if you were home.
- Install Cloudflare WARP on your device (Download).
- Go to Settings β Account β Login with Cloudflare Zero Trust.
- Enter your organization name (usually your Cloudflare account name, check One Dash).
- Login with your email (must be one of the allowed emails from setup).
- Connect!
Protect your services with email-based authentication:
User visits app.example.com
β Cloudflare prompts for email
β User receives login code
β Verified users access the service
When running the Cloudflare Tunnel wizard:
- Select Yes when asked about Cloudflare Access
- Enter authorized email addresses (comma-separated)
- Access policies are automatically created
- Go to Cloudflare Zero Trust
- Navigate to Access β Applications
- Add/remove email addresses as needed
If you prefer manual setup:
# Install cloudflared
brew install cloudflared # macOS
# or download from https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/installation/
# Login to Cloudflare
cloudflared tunnel login
# Create tunnel
cloudflared tunnel create easiarr
# Note the tunnel ID (UUID)Create ~/.cloudflared/config.yml:
tunnel: YOUR_TUNNEL_ID
credentials-file: /root/.cloudflared/YOUR_TUNNEL_ID.json
ingress:
- hostname: radarr.example.com
service: http://traefik:80
- hostname: sonarr.example.com
service: http://traefik:80
- hostname: jellyfin.example.com
service: http://traefik:80
# Add other services...
- service: http_status:404For each hostname, create a CNAME:
radarr.example.com β YOUR_TUNNEL_ID.cfargotunnel.com
cloudflared tunnel run easiarrOr via Docker (easiarr handles this):
cloudflared:
image: cloudflare/cloudflared:latest
command: tunnel run
environment:
TUNNEL_TOKEN: ${CLOUDFLARE_TUNNEL_TOKEN}ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Internet β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Cloudflare Edge Network β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β DDoS Shield β β CDN β β Access β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
Encrypted Tunnel
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Your Server β
β βββββββββββββββ β
β β Cloudflared β βββΊ Traefik βββΊ Services β
β βββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
easiarr configures ingress rules for all enabled apps:
| Subdomain | Service |
|---|---|
radarr.example.com |
Radarr |
sonarr.example.com |
Sonarr |
jellyfin.example.com |
Jellyfin |
homepage.example.com |
Homepage |
| ... | ... |
The last rule should be a catch-all 404:
- service: http_status:404- Enable Cloudflare Access for sensitive services
- Use Traefik authentication as backup
- Disable direct port exposure on your firewall
- Monitor Cloudflare analytics for unusual traffic
If Cloudflare Access is not enabled, easiarr configures Traefik basic authentication using your GLOBAL_USERNAME and GLOBAL_PASSWORD.
Error: No Cloudflare accounts found for this API token
Fix: Ensure token has Account:Account Settings:Read permission.
- Check cloudflared logs:
docker logs cloudflared
- Verify tunnel token is correct
- Test network connectivity
- Verify CNAME exists in Cloudflare DNS
- Wait for DNS propagation (up to 5 minutes)
- Check Cloudflare proxy status (orange cloud)
- Check email is in allowed list
- Clear browser cookies
- Try incognito mode
- Infrastructure#cloudflared - Cloudflared container details
- Traefik-Setup - Traefik configuration
- Environment-Variables - Cloudflare environment variables
easiarr - It could be easiarr | GitHub | npm | TRaSH Guides