Cloudflare Tunnel for TrueNAS Access
TrueNAS tutorial · Secure remote access
Cloudflare Tunnel for TrueNAS: Secure Remote Access Without Port Forwarding
A practical TrueNAS tutorial showing how to use Cloudflare Tunnel for remote access without inbound port forwarding, while adding an identity-aware access layer so the administrative interface is not exposed as an ordinary public web service.
Remote TrueNAS access without opening an inbound firewall port.
This guide shows how I implemented Cloudflare Tunnel on a TrueNAS SCALE homelab so a selected internal web interface could be reached remotely through a controlled hostname. The tunnel is initiated outbound from the homelab, which means the router does not need a conventional inbound port-forwarding rule for the proxied service.
The tutorial also improves on the common “just publish the NAS dashboard” approach. For an administrative interface, connectivity is only half of the design. The safer pattern is to put Cloudflare Access or another identity-aware control in front of the tunnel so an approved identity is required before traffic reaches TrueNAS.
Cloudflare becomes the controlled entry point; TrueNAS remains on the private network.
The original goal was to reach the TrueNAS web interface remotely through a domain name without opening router ports. The revised design adds another requirement: remote access should be restricted by identity before traffic reaches the internal administration service.
The connection starts inside the network.
Because `cloudflared` establishes the tunnel outbound, the router does not need a conventional inbound port-forwarding rule for the proxied service. Cloudflare routes approved traffic through the established tunnel to the internal service target.
What you need before creating the tunnel.
Create the tunnel, route the hostname, then add identity-aware access.
Create a named tunnel in Cloudflare and associate it with the connector running inside the homelab.
Deploy the Cloudflare Tunnel application/container and provide the tunnel credentials securely.
Point the tunnel route to the local TrueNAS administration service or another approved internal application.
Associate the public hostname with the tunnel route rather than a public IP address.
Require an approved identity, group, email domain, or other rule before Cloudflare forwards traffic to the tunnel.
Verify that unauthorized users are stopped by the access layer and that authorized access reaches the internal service successfully.
The public hostname maps to a private service target.
A locally managed `cloudflared` deployment can use a configuration structure similar to the sanitized example below. Exact paths and management methods vary depending on how the connector is deployed.
tunnel: <tunnel-uuid>
credentials-file: /etc/cloudflared/<tunnel-uuid>.json
ingress:
- hostname: admin.example.com
service: https://192.168.x.x:xxxx
- service: http_status:404
Add an authentication layer before exposing the TrueNAS login page.
A tunnel by itself provides connectivity. It does not automatically decide who should be allowed to reach an administrative interface. That authorization decision belongs in Cloudflare Access or another identity-aware control layer.
No port forwarding does not mean no security work.
Verify the access controls before using the tunnel for additional services.
After the tunnel is online, test from a network outside your home LAN. An unauthenticated request should be stopped by the access policy, while an approved identity should reach the intended internal service. Also confirm that no direct router port-forwarding rule is exposing the same TrueNAS management service in parallel.
Extending the same pattern
Once the tunnel and identity layer are stable, the same architecture can be reused for selected applications such as Snipe-IT, Immich, or other internal dashboards. Give each service its own hostname and access decision instead of treating every homelab application as equally safe to publish.
No comments:
Please Don't Spam Comment Box !!!!