When you delete a tunnel, the following operations are performed:
DNS Record Deletion: The DNS record pointing to the tunnel is immediately deleted
Cloudflare Tunnel Deletion: The Cloudflare tunnel is deleted from the Cloudflare API
Lease Deletion: The heartbeat lease is removed
Status Update: The tunnel status is changed to stopped
Audit Log: A tunnel.stopped audit log entry is created
If the tunnel has active connections, the deletion process may take longer. The tunnel will be marked as stopping and cleanup will continue in the background.
Always delete tunnels when your application shuts down to avoid leaving stale tunnels and DNS records.
Deleted tunnels cannot be recovered. If you need to expose the same port again, you’ll need to create a new tunnel.
If you’re experiencing issues with tunnel deletion, check the tunnel’s status with the List Tunnels endpoint. Tunnels in stopping state will be cleaned up automatically.