The `cloudflared tunnel delete` command is used to remove an existing Cloudflare Tunnel configuration from both your local machine (credential files) and the Cloudflare dashboard (control plane).
cloudflared tunnel delete <TUNNEL_NAME_OR_UUID> [flags]* `<TUNNEL_NAME_OR_UUID>`: **(Required)** This is the unique identifier for the tunnel you wish to delete. You can provide either the name you assigned to the tunnel during creation (e.g., `my-production-tunnel`) or its UUID (e.g., `a1b2c3d4-e5f6-7890-1234-567890abcdef`). You can find this information by running `cloudflared tunnel list`.
* `--force`, `-f`: **(Optional)** Forces the deletion of the tunnel even if `cloudflared` detects that the tunnel has active connections. Without this flag, `cloudflared` will warn you and prevent deletion if there are active connections, safeguarding against accidental service disruption.
1. **Delete a tunnel by name (assuming no active connections):**
cloudflared tunnel delete my-web-app-tunnel2. **Delete a tunnel by UUID:**
cloudflared tunnel delete a1b2c3d4-e5f6-7890-1234-567890abcdef3. **Force delete a tunnel by name, even if it has active connections:**
cloudflared tunnel delete my-staging-tunnel --forceWhen you execute `cloudflared tunnel delete`, `cloudflared` performs two primary actions:
1. **Removes from Cloudflare Control Plane:** The tunnel's configuration, including its name, UUID, and associated routes, is unregistered from your Cloudflare account. This means the tunnel will no longer appear in the Cloudflare dashboard under the Tunnels section.
2. **Removes Local Credentials:** `cloudflared` attempts to delete the associated tunnel credential file (e.g., `~/.cloudflared/<TUNNEL_UUID>.json`), which contains the necessary authentication tokens for the tunnel to connect to Cloudflare. If you have defined your tunnel configuration directly in `config.yml`, `cloudflared` will not modify that file, but the credential file is typically removed.
**Important Considerations:**
* **Active Connections and `--force`:** If a `cloudflared` process is actively running and connected using the tunnel you are trying to delete, the command will fail with an error message unless you use the `--force` flag. This is a safety mechanism to prevent accidental outages. Using `--force` will immediately terminate the tunnel's connection to Cloudflare, stopping any traffic flowing through it.
* **Impact on DNS Records:** If you have DNS records (e.g., CNAMEs) pointing to the tunnel's hostname, these records will effectively become non-functional once the tunnel is deleted, as there will be no backend to resolve to. You should update or remove any such DNS records after deleting a tunnel.
* **Irreversible Action:** Deleting a tunnel is an irreversible action. Once deleted, the tunnel cannot be recovered. If you need to bring it back, you will have to create a new tunnel with a new UUID and reconfigure all its settings and associated DNS records.
* **Zombie Tunnels:** It's good practice to ensure all `cloudflared` processes for a specific tunnel are stopped before deleting it, or to use `--force` intentionally, to avoid