brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Put a website on your Unraid server online with a Cloudflare Tunnel

Put a website on your Unraid server online with a Cloudflare Tunnel

Guide unraid

15 steps 12 min read

I like a home server with a closed router. A Cloudflare Tunnel makes that possible for a website on Unraid: a small container on the server calls out to Cloudflare, and Cloudflare sends visitors back over that same connection. You open no ports on your router, a changing home IP stops being your problem, and Cloudflare handles the HTTPS certificate. This guide walks the whole route, from an empty tunnel in the Cloudflare dashboard to a page on a real hostname, with a screenshot of every step.

Time
12 min
Steps
15
Updated
30 Nov 2026

You will learn

  • What a Cloudflare Tunnel does
  • What do I need before I start?
  • Create the tunnel in the Cloudflare…
  • Choose Docker and copy the token
  • Find a cloudflared template in Commu…

Step 1 of 15: What a Cloudflare Tunnel does

A tunnel has two halves. In the Cloudflare dashboard you create the tunnel and decide which hostname goes to which app. On your own server, a connector called cloudflared logs in to Cloudflare with a token and keeps an outbound connection open. Cloudflare’s docs describe it exactly that way: cloudflared starts the connection from inside your network, so your firewall can block every inbound connection.

When someone opens your hostname, the request lands at Cloudflare first. Cloudflare pushes it down the tunnel, cloudflared hands it to the app on your LAN, and the answer goes back the same way. Your router never sees an incoming connection, and your home IP never appears in DNS.

For the screenshots I made a real test tunnel called unraid-guide and published the default nginx welcome page from my Unraid server at unraid-demo.nextdash.cc. The picture below is where you end up: one connector, one route, status Healthy. I blurred the connector details, because they include the public IP of the house.

Cloudflare tunnel overview for unraid-guide: one active replica, one route, status Healthy, route unraid-demo.nextdash.cc as published application

Step 2 of 15: What do I need before I start?

  • An Unraid server with Docker enabled and the Community Applications plugin (the Apps tab). The screenshots show Unraid 7.4.1.
  • A domain that uses Cloudflare as its DNS provider. The free plan is enough. The domain has to be added to Cloudflare before you start, because the route step only lets you pick zones that live in your account.
  • A web app on Unraid that already works on the LAN. Open it in a browser at the server’s address and port first. If it does not load there, a tunnel will not fix it.
  • A free hostname on that domain. Check it first: the hostname I wanted, demo.nextdash.cc, was already in use, so I took unraid-demo.

You do not need a static IP, port forwarding, Nginx Proxy Manager or a certificate. That’s the appeal. If your server can reach the internet on port 7844, cloudflared can reach Cloudflare; the docs say to check that port when you sit behind a strict firewall.

Step 3 of 15: Create the tunnel in the Cloudflare dashboard

Log in at dash.cloudflare.com and open Networking, then Tunnels. Older guides send you to Zero Trust, then Networks; that page now shows a notice that tunnels have moved, with a button that takes you to the new place.

  1. Click Create Tunnel at the top right.
  2. Give it a name you will recognise in a year. I’d name it after the machine or the job, so unraid-guide or tower-web, not test.
  3. Click Create Tunnel again. The tunnel now exists, gets a Tunnel ID, and waits for a connector.

One tunnel can carry many hostnames, so you do not need a tunnel per website. I’d make one tunnel per server and add routes to it as you go.

Cloudflare dashboard, Create a Tunnel form with the name unraid-guide filled in

Step 4 of 15: Choose Docker and copy the token

Under Setup Environment you pick an operating system. Unraid runs cloudflared as a container, so click Docker. Cloudflare then shows one command:

docker run cloudflare/cloudflared:latest tunnel --no-autoupdate run --token <your-token>

You will not paste this whole line into a terminal on Unraid. You only need the long string after --token, and you will put it in the Unraid template in the next step. Click the copy button next to the command; the token is at the end.

Take the orange notice above the command seriously. The token lets anyone run a connector for your tunnel, so they could put their own machine behind your hostnames. Do not paste it into a forum post, a screenshot or a Git repo. If it leaks, the tunnel’s Overview page has a Rotate token button that makes the old one useless.

Leave this browser tab open. Cloudflare waits at Connection Status until your connector checks in.

Cloudflare tunnel setup with Docker selected, the security notice about the token and the docker run command

Step 5 of 15: Find a cloudflared template in Community Applications

On Unraid, open the Apps tab and search for cloudflared. You get a handful of templates that all run the same Cloudflare program in different wrappers. Some ask for the full command, some for a config file, and some only for the token.

I picked Unraid-Cloudflared-Tunnel from Figro’s repository, the one with the Monthly Spotlight badge. It needs one field, TUNNEL_TOKEN, which suits a tunnel you manage from the dashboard. The project is on GitHub as AriaGomes/Unraid-Cloudflared-Tunnel under the GPL-2.0 licence. Its README says it only supports amd64, which covers nearly every Unraid box, and that it fetches a newer cloudflared binary when the one it has is out of date.

If you would rather run Cloudflare’s own image, the cloudflared template from aeleos’s repository uses cloudflare/cloudflared. Then you fill in the arguments yourself: tunnel --no-autoupdate run --token followed by the token.

Unraid Apps tab with search results for cloudflared, including Unraid-Cloudflared-Tunnel from Figro's repository

Step 6 of 15: Fill in the Unraid template

Click Install on the template. The Add Container form opens. Only a few fields matter here:

  • Name: anything you like. I used cloudflared-guide, because the server already had an older stopped container called cloudflared.
  • Network Type: leave it on Bridge. cloudflared only makes outgoing connections, so it needs no ports and no address of its own on the LAN.
  • TUNNEL_TOKEN: paste the token from step 2, only the part after --token.
  • NO_AUTOUPDATE: the template sets it to true. The description warns that auto-updates can drop the tunnel. Update the container from the Docker tab instead, like any other app.

Click Apply. Unraid pulls the image (about 3 MB for this template) and starts the container. The template also stores its state under /mnt/user/appdata/<app> and exposes a metrics port; you can leave both as they are.

The install window prints the complete docker run line, token included. Close it before you take a screenshot for anyone.

Unraid Add Container form for the cloudflared template with Network Type Bridge, a blurred TUNNEL_TOKEN and NO_AUTOUPDATE set to true

Step 7 of 15: Check that the tunnel connects

Go back to the Cloudflare tab. Within a few seconds the box under Connection Status turns green with Tunnel connected successfully. Click Continue.

The tunnel list now shows the tunnel as Healthy, with one replica and the cloudflared version that connected (2026.11.2 in my screenshot). The Routes column still says No routes: the tunnel is up, but it does not send anything anywhere yet.

If the box keeps spinning, look at the container log on Unraid (click the container icon in the Docker tab, then Logs). An invalid token error means a copy mistake; paste it again and watch for a missing first or last character.

Cloudflare Connection Status showing Tunnel connected successfully

Step 8 of 15: Add a route for your website

Open the tunnel and go to the Routes tab, then click Add route. Cloudflare offers four types. For a website that strangers can open in a browser you want Published application. The others are for private access with the WARP client (Private hostname, Private CIDR) and for Cloudflare Workers (Workers VPC).

Cloudflare Add a route dialog with Published application, Private hostname, Private CIDR and Workers VPC

Step 9 of 15: Pick the hostname and the service URL

This form decides what the world sees. Fill it in from top to bottom:

  1. Subdomain: the part before your domain, in my case unraid-demo. Leave it empty to use the bare domain.
  2. Domain: pick your zone from the list. Check this field twice. The form had already filled in a different domain of mine, and a click on Add route would have put the test page on the wrong site.
  3. Service URL: where cloudflared finds the app, as seen from inside the cloudflared container.

That last field trips up a lot of people. In bridge mode localhost means the cloudflared container itself, not your Unraid server. Use the server’s LAN address and the port Unraid shows in the LAN IP:PORT column of the Docker tab, for example:

http://192.168.1.10:8080

If you put cloudflared and the app on the same custom Docker network, you can use the container name instead, such as http://nginx:80. That keeps working when the server’s LAN address changes.

An app that only speaks HTTPS with a self-signed certificate, like many admin panels, needs https:// in the service URL and No TLS Verify under Additional application settings. Otherwise cloudflared refuses the certificate and visitors see a 502.

Add published application form with subdomain unraid-demo, domain nextdash.cc and a blurred service URL

Step 10 of 15: Check the DNS record and open the site

Click Add route. Cloudflare confirms the route and shows the DNS record it made for you: a CNAME from your hostname to <tunnel-id>.cfargotunnel.com. You do not touch the DNS page yourself. If a record with that name already exists, Cloudflare refuses the route, which is a good reason to pick a fresh subdomain.

Then open the hostname in a browser. For me it showed the nginx welcome page from Unraid, with a valid certificate from Cloudflare.

One snag I ran into while testing: my Mac said the hostname did not exist, while dig unraid-demo.nextdash.cc @1.1.1.1 already returned Cloudflare’s addresses. My local DNS resolver had cached the earlier “no such name” answer from when I checked if the name was free. It sorts itself out after a few minutes. If you run AdGuard Home or Pi-hole, clearing its cache is quicker.

Route added successfully, with the CNAME record from unraid-demo.nextdash.cc to the tunnel's cfargotunnel.com address

Step 11 of 15: How do I see that everything runs?

There are two places to look. On Unraid, the Docker tab shows the cloudflared container as started. Turn on Autostart for it (the template leaves it off), or your site disappears after the next reboot until you start the container by hand.

In Cloudflare, the tunnel’s Overview page shows the active replicas, the number of routes, the status and the uptime. Under Configure alerts you can get an e-mail when the tunnel goes down. I’d turn that on for anything other people rely on.

Want a second connector, for example on another machine? Add a replica gives you the same token, and Cloudflare spreads traffic over both. For one home server that is overkill; for a site that must stay up while you reboot Unraid, it helps.

Unraid Docker tab with the cloudflared-guide container started in bridge mode, addresses blurred

Step 12 of 15: Put a login in front of it with Cloudflare Access

A published application is open to the whole internet. That’s fine for a blog or a static page. For anything with an admin screen (your *arr apps, a dashboard, a file manager) I’d never publish it without a login in front.

Cloudflare Access does that at Cloudflare’s edge, before a request reaches your server. You create a self-hosted application for the same hostname in Zero Trust, add a policy (for example: only these e-mail addresses), and pick a login method. Cloudflare’s docs are blunt about the order: without an Access application in place, the published app is available to anyone on the internet. So set up Access first and add the route after it, or add the route and the policy in one sitting.

Access also helps with apps whose own login you do not trust much. A stranger never reaches the app’s login page at all.

Step 13 of 15: What not to send through a tunnel

Jellyfin and Plex are the obvious next idea, and that’s where Cloudflare’s terms say no. The service-specific terms for the CDN on the Free, Pro and Business plans say you must use paid services such as Stream to “serve video and other large files via the CDN” (Cloudflare, service-specific terms). Cloudflare may limit or switch off an account that streams video through the normal CDN anyway.

For films and series I’d use Tailscale instead: it connects your own devices straight to the server and Cloudflare is not in the path. A tunnel is a good fit for websites, small web apps, webhooks for Home Assistant and APIs.

Uploads have limits too. On the free plan a single request body is capped at 100 MB, so a Nextcloud upload of a large file through a tunnel fails unless the client splits it into chunks.

Step 14 of 15: When it breaks: the usual suspects

  • Error 1033 in the browser: Cloudflare can not reach a connector. The container is stopped, or the token belongs to another tunnel. Start the container and check the status in the tunnel list.
  • 502 Bad Gateway: the tunnel is up, but cloudflared can not reach the service URL. Usually localhost where a LAN address belongs, a wrong port, or http versus https. Test the exact URL from another machine on your LAN.
  • Too many redirects: the app redirects HTTP to HTTPS itself while Cloudflare already handles HTTPS. Point the service URL at the app’s HTTPS port, or switch the app’s own redirect off.
  • The site works, then stops after a reboot: Autostart is off on the cloudflared container.
  • The route is refused: a DNS record with that name already exists in the zone. Pick another subdomain or remove the old record first, after checking what it was for.

Cleaning up a test takes three steps. Stop and remove the container on Unraid, then delete the tunnel in the tunnel list (its routes go with it). Last, open the DNS records of your zone and delete the CNAME that points to <tunnel-id>.cfargotunnel.com. Don’t skip that one: when I removed my test, the record stayed behind after I deleted the route, and the delete dialog for the tunnel says plainly that it leaves DNS records alone.

Step 15 of 15: Tunnel, Tailscale or a reverse proxy?

I run Nginx Proxy Manager and Tailscale on my Unraid server as well, so this is a choice I recognise. My rule of thumb: Tailscale for everything only I or my family use, a Cloudflare Tunnel for things strangers should be able to open, and a reverse proxy with open ports only when Cloudflare should not sit in between, for example for traffic Cloudflare’s terms do not allow.

The tunnel wins on setup. Ten minutes, no router settings, and it keeps working when you move house or change provider, because the server always dials out. The cost is that Cloudflare sees all traffic to that hostname, including the HTTPS content, since it terminates TLS. For a public website I can live with that. For my photos, I can’t.

Further reading

Link