Jellyfin Cloudflare Tunnel Setup Guide (2026)
Cloudflare Tunnel is the most popular free method for remote Jellyfin access in 2026. It creates an outbound-only connection from your server to Cloudflare edge network - no open ports, no dynamic DNS, automatic SSL, and free DDoS protection.
How Cloudflare Tunnel Works
User (internet) → Cloudflare Edge → Encrypted Tunnel → Your Server → Jellyfin
The cloudflared daemon on your server establishes an outbound connection to Cloudflare. Your home IP is never exposed.
Advantages over port forwarding
| Feature | Port Forwarding | Cloudflare Tunnel |
|---|---|---|
| Open ports required | Yes (443) | No |
| Works behind CGNAT | No | Yes |
| Free SSL certificate | Manual (Certbot) | Automatic |
| DDoS protection | No | Yes (free tier) |
| Hides home IP | No | Yes |
Prerequisites
- A domain name (any registrar)
- Domain DNS managed by Cloudflare (free plan)
- Docker installed on your Jellyfin server
- A Cloudflare account (free)
Step 1: Add Your Domain to Cloudflare
- Log in to dash.cloudflare.com
- Click Add a Site, enter your domain
- Select the Free plan
- Update your domain nameservers at your registrar to Cloudflare nameservers
- Wait for propagation (usually 5-30 minutes)
Step 2: Create a Cloudflare Tunnel
Via Cloudflare Dashboard (Easiest)
- Go to Zero Trust, Networks, Tunnels
- Click Create a tunnel
- Name it: jellyfin
- Choose Cloudflared as the connector
- Cloudflare gives you a token - copy it
Via CLI
curl -fsSL https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -o /usr/local/bin/cloudflared
chmod +x /usr/local/bin/cloudflared
cloudflared tunnel login
cloudflared tunnel create jellyfin
Step 3: Run cloudflared with Docker
Add to your docker-compose.yml:
services:
cloudflared:
image: cloudflare/cloudflared:latest
command: tunnel --no-autoupdate run --token YOUR_TUNNEL_TOKEN
restart: unless-stopped
depends_on:
- jellyfin
jellyfin:
image: jellyfin/jellyfin:latest
container_name: jellyfin
volumes:
- ./config:/config
- ./cache:/cache
- /mnt/media:/media:ro
restart: unless-stopped
Replace YOUR_TUNNEL_TOKEN with the token from Step 2.
docker compose up -d
Step 4: Configure DNS Routing
In Cloudflare Dashboard, Zero Trust, Tunnels, your tunnel, Public Hostname:
- Click Add a public hostname
- Subdomain: jellyfin
- Domain: yourdomain.com
- Service type: HTTP
- URL: jellyfin:8096 (Docker service name) or localhost:8096
- Save
Your Jellyfin server is now accessible at https://jellyfin.yourdomain.com.
Step 5: Configure Jellyfin for Tunnel Access
Dashboard, Networking, Published server URL: https://jellyfin.yourdomain.com
Add Cloudflare as a trusted proxy
Dashboard, Networking, Known Proxies - add Cloudflare IP ranges:
173.245.48.0/20
103.21.244.0/22
103.22.200.0/22
103.31.4.0/22
141.101.64.0/18
108.162.192.0/18
190.93.240.0/20
188.114.96.0/20
197.234.240.0/22
198.41.128.0/17
162.158.0.0/15
104.16.0.0/13
104.24.0.0/14
172.64.0.0/13
131.0.72.0/22
The Cloudflare ToS Question
Cloudflare ToS Section 2.8 historically prohibited using their free CDN for serving large amounts of non-HTML content. The 2026 reality:
- Cloudflare Tunnel traffic is not cached by default
- Many thousands of Jellyfin users run Cloudflare Tunnels without issues
- Cloudflare has not enforced Section 2.8 against tunnel users streaming personal media
Recommendation: Use Cloudflare Tunnel for remote access. Do not enable CDN caching for video content.
Cloudflare Tunnel vs Tailscale vs WireGuard
| Feature | Cloudflare Tunnel | Tailscale | WireGuard |
|---|---|---|---|
| Open ports | None | None | 1 UDP |
| Works behind CGNAT | Yes | Yes | No |
| Client install required | No (browser) | Yes (all devices) | Yes (all devices) |
| Free SSL | Yes | N/A | N/A |
| DDoS protection | Yes | No | No |
| Best for | Browser access, sharing | Personal devices | Maximum performance |
Troubleshooting
| Problem | Fix |
|---|---|
| 502 Bad Gateway | Jellyfin not running or wrong service URL |
| SSL error | Wait for Cloudflare certificate provisioning (up to 15 min) |
| Slow loading | Normal - tunnel adds 20-50ms latency |
| Mobile app cannot connect | Use the full HTTPS URL including subdomain |
Remote access configured? Monitor every session from your phone. Download JellyWatch on Google Play - works over Cloudflare Tunnel to monitor your Jellyfin server in real time.




Comments 2
My ISP uses CGNAT so port forwarding was impossible. Cloudflare Tunnel solved it in 10 minutes. Free, no open ports, automatic SSL. Cannot believe this is free.
Measured about 30-40ms extra latency through the tunnel compared to direct access. Completely unnoticeable during streaming. 4K remuxes play without any buffering.
Leave a comment