# How to Destroy a VPC A Virtual Private Cloud (VPC) is a private network interface for collections of DigitalOcean resources. VPC networks are inaccessible from the public internet and other VPC networks, and traffic on them doesn’t count against bandwidth usage. You can link VPC networks to each other using VPC peering connections. Deleting a VPC network permanently and irreversibly destroys the network. You can only destroy a VPC network that has no resources in it. You can either destroy the resources or safely [migrate Droplets, volumes, and databases](https://docs.digitalocean.com/products/networking/vpc/how-to/migrate-resources/index.html.md) out of a VPC network first. ## Delete a VPC Network Using Automation ## How to Delete a VPC Network Using the DigitalOcean CLI 1. [Install `doctl`](https://docs.digitalocean.com/reference/doctl/how-to/install/index.html.md), the official DigitalOcean CLI. 2. [Create a personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and save it for use with `doctl`. 3. Use the token to grant `doctl` access to your DigitalOcean account. ```shell doctl auth init ``` 4. Finally, run `doctl vpcs delete`. Basic usage looks like this, but you can [read the usage docs](https://docs.digitalocean.com/reference/doctl/reference/vpcs/delete/index.html.md) for more details: ```shell doctl vpcs delete [flags] ``` The following example deletes the VPC network with the ID `f81d4fae-7dec-11d0-a765-00a0c91e6bf6`: ```shell doctl vpcs delete f81d4fae-7dec-11d0-a765-00a0c91e6bf6 ``` ## How to Delete a VPC Network Using the DigitalOcean API 1. [Create a personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and save it for use with the API. 2. Send a DELETE request to [`https://api.digitalocean.com/v2/vpcs/{vpc_id}`](https://docs.digitalocean.com/reference/api/digitalocean//index.html.md#operation/vpcs_delete). ### cURL Using cURL: ```shell curl -X DELETE \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ "https://api.digitalocean.com/v2/vpcs/e0fe0f4d-596a-465e-a902-571ce57b79fa" ``` ### Go Using [Godo](https://github.com/digitalocean/godo), the official DigitalOcean API client for Go: ```go import ( "context" "os" "github.com/digitalocean/godo" ) func main() { token := os.Getenv("DIGITALOCEAN_TOKEN") client := godo.NewFromToken(token) ctx := context.TODO() resp, err := client.VPCs.Delete(ctx, "5a4981aa-9653-4bd1-bef5-d6bff52042e4") } ``` ### Python Using [PyDo](https://github.com/digitalocean/pydo), the official DigitalOcean API client for Python: ```python import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) resp = client.vpcs.delete(vpc_id="e0fe0f4d") ``` ## Delete a VPC Network Using the Control Panel To destroy a VPC network, click **Networking** in the main menu, then click the **VPC** tab. In the **VPC Networks** tab, click the **More** menu of the VPC network you want to destroy and select **Edit Settings**. ![VPC Networks page showing a VPC network and its datacenter region, including the VPC name, and IP range.](https://docs.digitalocean.com/screenshots/vpc/overview.69056a8522251a5d03c57a21545c544a303f8d7c78d94b34dfc7601e8d939d18.png) In the VPC network’s **Settings** tab, click **Destroy VPC**. In the confirmation window, click **Confirm** to destroy the VPC network.