Cloudflared Tunnel Random subdomain url to Custom domain url

Hello Everyone,

I’m wondering if the command cloudflared --url localhost:<port> will generate a random URL like random.trycloudflare.com Is there any way to have a custom subdomain, such as my-sub-domain.trycloudflare.com instead?

Thank you.

It’ll always be random.

If you want a Custom Domain, add a zone/website to Cloudflare, and use a persistent tunnel, then you can use your custom domain, and the tunnel can be on the apex (yourdomain.com), or a specific subdomain (my-cool-tunnel.yourdomain.com), etc.
Via the dashboard · Cloudflare Zero Trust docs
Also, important to note, the free/quick tunnels have are not meant for production websites/etc and are used for tests:

  • We don’t guarantee any SLA or uptime of TryCloudflare - we plan to test new Cloudflare Tunnel features and improvements on these free tunnels. This provides us with a group of connections to test before we deploy to production customers. Free tunnels are meant to be used for testing and development, not for deploying a production website.

Whereas an actual persistent tunnel is meant for production.