Publish a home-hosted application with Cloudflare Tunnel: design and checks

AI-generated image; illustrative scene.
Cloudflare Tunnel can connect a home-hosted application to a public hostname through outbound cloudflared connections. Avoiding inbound router port forwarding does not make the application secure by itself. Before publishing a SaaS, review authentication, permissions, updates, backups and availability.
A hypothetical design
Imagine a web application in Docker and a cloudflared connector able to reach its service. Cloudflare can associate a public hostname with an origin address and port; access to a published hostname can be open to the internet unless appropriate restrictions are configured. An Nginx proxy can help with certain routes, but is not mandatory in every design. This example describes a possible architecture, not a completed migration or a security guarantee.
If you use separate containers, check that they share the necessary network and that the configured address is reachable from the connector. With the usual isolated network, localhost inside a container refers to its own network namespace, not automatically to another service; shared or host networking changes that behaviour. Avoid publishing container ports you do not need: Docker documents that published ports bind to all interfaces by default unless another address is configured.
Check each layer before exposing it
- Service: verify locally that the application works and that its configuration and data have restorable backups. If using Nginx,
nginx -tchecks syntax and attempts to open referenced files; it does not prove that the whole service works. - Tunnel: follow the official Cloudflare guide to create the tunnel and an application route to the correct origin. Treat the token as a credential and do not publish it in the repository.
- Access: decide whether the application should be public or restricted. For a private application, review and test access policies before sharing the hostname; the Cloudflare documentation explains that a published route can be accessible on the internet.
- Operations: update components, monitor failures, protect data and test restores. Consider home power or connection outages and decide what to do if the service becomes unavailable.
Verify externally with a rollback plan
In a test environment, check allowed and denied access, that the origin responds as expected, logs and recovery after restart. Also check for accidentally exposed routes or ports. Document the previous state and how to roll back before changing production.
An HTTP 200 status only confirms that a particular request received that type of response; it does not prove that the entire application is secure or that a backup can be restored. We have not deployed or tested this architecture as part of this guide.