{"record":{"id":"7d504869e4a3ff1a","repo":"cloudflare/cloudflared","slug":"errdeprecatedclassictunnel","errorCode":"errDeprecatedClassicTunnel","errorMessage":"Classic tunnels have been deprecated, please use Named Tunnels. (https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/tunnel-guide/)","messagePattern":"Classic tunnels have been deprecated, please use Named Tunnels\\. \\(https://developers\\.cloudflare\\.com/cloudflare-one/connections/connect-apps/install-and-setup/tunnel-guide/\\)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cloudflared/tunnel/cmd.go","lineNumber":74,"sourceCode":"\n\ttunnelCmdErrorMessage = `You did not specify any valid additional argument to the cloudflared tunnel command.\n\nIf you are trying to run a Quick Tunnel then you need to explicitly pass the --url flag.\nEg. cloudflared tunnel --url localhost:8080/.\n\nPlease note that Quick Tunnels are meant to be ephemeral and should only be used for testing purposes.\nFor production usage, we recommend creating Named Tunnels. (https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/tunnel-guide/)\n`\n)\n\nvar (\n\tgraceShutdownC chan struct{}\n\tbuildInfo      *cliutil.BuildInfo\n\n\trouteFailMsg = fmt.Sprintf(\"failed to provision routing, please create it manually via Cloudflare dashboard or UI; \"+\n\t\t\"most likely you already have a conflicting record there. You can also rerun this command with --%s to overwrite \"+\n\t\t\"any existing DNS records for this hostname.\", overwriteDNSFlag)\n\terrDeprecatedClassicTunnel = errors.New(\"Classic tunnels have been deprecated, please use Named Tunnels. (https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/tunnel-guide/)\")\n\t// TODO: TUN-8756 the list below denotes the flags that do not possess any kind of sensitive information\n\t// however this approach is not maintainble in the long-term.\n\tnonSecretFlagsList = []string{\n\t\t\"config\",\n\t\tcfdflags.AutoUpdateFreq,\n\t\tcfdflags.NoAutoUpdate,\n\t\tcfdflags.NoPrechecks,\n\t\tcfdflags.Metrics,\n\t\t\"pidfile\",\n\t\t\"url\",\n\t\t\"hello-world\",\n\t\t\"socks5\",\n\t\t\"proxy-connect-timeout\",\n\t\t\"proxy-tls-timeout\",\n\t\t\"proxy-tcp-keepalive\",\n\t\t\"proxy-no-happy-eyeballs\",\n\t\t\"proxy-keepalive-connections\",\n\t\t\"proxy-keepalive-timeout\",","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/cmd/cloudflared/tunnel/cmd.go#L56-L92","documentation":"Classic (hostname-routed) tunnels were retired; cloudflared only supports Named Tunnels. TunnelCommand returns errDeprecatedClassicTunnel when it detects classic-tunnel usage via the --hostname flag, pointing users at the Named Tunnels migration guide.","triggerScenarios":"Running `cloudflared tunnel` (e.g. `tunnel create`/run flows) with --hostname set — the flag combination that used to signal a classic, hostname-bound tunnel.","commonSituations":"Old scripts/config files from pre-2021 setups using `cert.pem` + `--hostname`; migration from legacy tunnels to Zero Trust Named Tunnels; tutorials predating Named Tunnels.","solutions":["Remove --hostname from the command/config and create a Named Tunnel: `cloudflared tunnel create <name>`.","Route the tunnel with `cloudflared tunnel route dns <tunnel> <hostname>` instead of --hostname.","Migrate per the linked guide: log in with `cloudflared tunnel login`, use tunnel credentials file/`--token`, and define ingress in config.yml.","If running via dashboard remotely-managed tunnels, install the service with the tunnel token instead."],"exampleFix":"# before (classic)\ncloudflared tunnel --hostname app.example.com --url http://localhost:8080\n# after (named)\ncloudflared tunnel create my-tunnel\ncloudflared tunnel route dns my-tunnel app.example.com\ncloudflared tunnel run my-tunnel","handlingStrategy":"validation","validationCode":"for a in \"$@\"; do\n  if [ \"$a\" = \"--hostname\" ]; then\n    echo \"classic tunnels are deprecated; use Named Tunnels (tunnel create + route dns)\"; exit 2\n  fi\ndone","typeGuard":null,"tryCatchPattern":"if err := cmd.Run(); err != nil {\n    if strings.Contains(err.Error(), \"Classic tunnels have been deprecated\") {\n        return migrateToNamedTunnel(ctx) // automated migration path\n    }\n    return err\n}","preventionTips":["Remove --hostname from all tunnel commands and config files.","Use Named Tunnels exclusively: create, route dns, run (or remote-managed via dashboard token).","Search repos/docs for `--hostname` alongside `cloudflared tunnel` and update playbooks."],"tags":["cli","deprecated","tunnel","migration"],"backgroundTag":"deprecated-api-usage","analyzedSha":"2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f","analyzedAt":"2026-09-06T04:14:33.757Z","contentChangedAt":"2026-09-06T04:14:33.757Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}