Validated on 1 Jun 2023 • Last edited on 23 May 2024
DigitalOcean Cloud Firewalls are a network-based, stateful firewall service for Droplets provided at no additional cost. Cloud firewalls block all traffic that isn’t expressly permitted by a rule.
Destroy a Firewall Using the CLI
The destroy command requires the firewall’s ID to be destroyed. To retrieve a list of firewalls and their IDs, use the doctl compute firewall list command.
How to destroy a firewall using the DigitalOcean CLI
To destroy a firewall via the command-line, follow these steps:
Use the token to grant doctl access to your
DigitalOcean account.
doctl auth init
Finally, destroy a firewall with
doctl compute firewall delete. The basic usage looks
like this, but you'll want to read the usage docs for more details:
doctl compute firewall delete <id>... [flags]
The following example deletes a cloud firewall with the ID f81d4fae-7dec-11d0-a765-00a0c91e6bf6
import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
resp = client.firewalls.delete(firewall_id= "as9di9d")
Destroy a Firewall Using the Control Panel
To destroy a firewall, from the Networking section of the control panel, click the Firewalls tab. Open the More menu of the firewall you want to destroy and click Destroy.
In the Destroy Firewall window that opens, click Confirm to destroy the firewall. Destroying a firewall does not destroy the Droplets that were associated with it.