Validated on 1 Jun 2023 • Last edited on 2 Jul 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
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.