The `cloudflared tunnel delete` command is used to remove an existing Cloudflare Tunnel. This command will unregister the tunnel from Cloudflare's network, making it inactive and preventing any associated traffic from being routed through it.
cloudflared tunnel delete <NAME | UUID> [flags]* `<NAME | UUID>`: This is a required argument that specifies the tunnel you want to delete. You can provide either the human-readable name you assigned to the tunnel when it was created, or its unique identifier (UUID).
* `-f, --force`: This flag allows you to force the deletion of a tunnel even if it has associated ingress rules or public hostnames (routes). Without this flag, if the tunnel has active routes, the deletion will fail with an error, prompting you to either remove the routes first or use `--force`. It is highly recommended to remove all associated routes (e.g., `cloudflared tunnel route ip delete` or `cloudflared tunnel route hostname delete`) before deleting a tunnel to avoid orphaned DNS records or ingress configurations.
* `--is-autodeleted`: Marks the tunnel as autodeleted. This flag is primarily for internal use by Cloudflare systems and is generally not used for manual tunnel deletion.
1. **Deleting a tunnel by its name:**
Suppose you have a tunnel named `my-web-app`. To delete it:
cloudflared tunnel delete my-web-appIf successful, `cloudflared` will confirm the deletion:
Tunnel my-web-app deleted successfully2. **Deleting a tunnel by its UUID:**
If you know the UUID of your tunnel (e.g., `a1b2c3d4-e5f6-7890-1234-567890abcdef`), you can delete it using:
cloudflared tunnel delete a1b2c3d4-e5f6-7890-1234-567890abcdef3. **Forcing the deletion of a tunnel with associated routes:**
If `my-web-app` has active ingress rules or public hostnames pointing to it, a direct `delete` command might fail:
cloudflared tunnel delete my-web-app
# Output might be: Error deleting tunnel: tunnel 'my-web-app' still has associated routesTo bypass this and force the deletion, use the `--force` flag:
cloudflared tunnel delete my-web-app --force**Caution**: Forcing deletion can leave orphaned DNS records or ingress configurations that no longer point to an active tunnel. It's generally better practice to clean up routes explicitly before deleting a tunnel.
When you delete a tunnel, `cloudflared` communicates with the Cloudflare control plane to unregister the tunnel. This means:
* The tunnel's UUID and name are removed from your Cloudflare account.
* Any `cloudflared` processes running for that specific tunnel will lose their connection to Cloudflare's network and should be stopped.
* Traffic previously routed through this tunnel will no longer be served. If you have DNS records or CNAMEs pointing to the tunnel's Cloudflare managed DNS entry (e.g., `your-tunnel-uuid.cfargotunnel.com`), those will effectively stop working.
It's important to understand the implications, especially regarding associated routes. If you delete a tunnel without first removing its ingress rules or public hostnames, those rules will remain configured in Cloudflare but will be pointing to a non-existent tunnel. While using `--force` handles the tunnel deletion, you might still need to manually clean up any related DNS records or hostname routes in your Cloudflare dashboard to prevent confusion or potential issues later. Always verify that all components related to the tunnel are properly decommissioned after deletion.