Tech News

Cloudflare Tunnel enables easy sharing of self-hosted services

Cloudflare Tunnel provides a public web address for self-hosted services like FileBrowser Quantum, allowing users to share folders without requiring others to install apps or join private networks like Tailscale. This method uses the cloudflared tool to forward traffic securely.

Cloudflare Tunnel enables easy sharing of self-hosted services

I use Tailscale to put my phone and my home server on a private network so they can reach each other securely. This works well when I need to access my files and dashboards from anywhere, but sharing a PhotoPrism gallery with a relative requires me to invite them and help them install an app. I do not want to become IT support every time a friend asks for a photo album. Tailscale works by putting my devices on my own private network, which is perfect for personal access. However, Cloudflare Tunnel solves the sharing problem by giving my self-hosted services a normal web address that anyone can visit without an account or a new app. While Tailscale acts as my private control room, Cloudflare Tunnel acts as a friendly front porch.

How I share a folder via Cloudflare

The process to share a folder starts within a service like FileBrowser Quantum. I run FileBrowser Quantum in Docker on port 8080, pick a specific folder, set it to read-only, and add a password. This prevents the exposure of my remaining personal files to the person I share with. I then start a temporary Cloudflare Tunnel container using the cloudflared tool to forward traffic to my app’s local address and port. Because the cloudflared app on my server makes an outbound connection to Cloudflare, I do not need to open incoming ports on my router or expose my home IP address. I use the --rm flag to tell Docker to delete the container when I shut it down. This action takes my service off the internet and keeps my system clean. After a few seconds, Cloudflare prints a random, temporary public address in my terminal. I take my original local share link, replace the local IP and port part with the random Cloudflare address, and then I send that link to my family or my colleagues who need access to the folder. For example, I replace http://192.168.8.220:8080 with the new address and keep the rest of the path the same. If I only want to share a website or landing page, I skip the custom link and use the local address I normally use to visit the service. This method also works for services like Immich, where I can share selected photos through a custom link.

Tool Function
Tailscale Connects phone and server to a private network
Cloudflare Tunnel Provides a normal web address for self-hosted services
cloudflared Forwards traffic from Cloudflare to a local port
Docker Runs the tunnel container with the --rm flag

Security and traffic trade-offs

Cloudflare Tunnel is not a replacement for Tailscale because of the exposure trade-off. A public hostname is public even with a password, whereas Tailscale keeps a service invisible unless I invite someone into my private network. I would never use Cloudflare Tunnel to expose a database interface or an admin page with weak authentication. Every request passes through Cloudflare, which means I depend on their infrastructure to reach my server. If Cloudflare has an outage, my public links stop working even if my home server is fine. Tailscale depends on its own infrastructure too, but I have the option to use Headscale later if I want to move away from Tailscale. Cloudflare uses QUIC for fast, encrypted connections, and its platform includes DDoS protection and Bot Fight Mode. However, Cloudflare places restrictions on video streaming or large-file delivery for users on Free and Pro plans. I use both tools to get the best version of self-hosting. I ask who needs access and how much friction they should tolerate. The setup requires a bit of terminal work, but the result makes my home server something my friends and family can actually use. Tailscale protects the private parts of my home lab, while Cloudflare Tunnel makes the parts worth sharing feel effortless.