# How to Delete Projects Projects let you organize your DigitalOcean resources into groups that fit the way you work. Create projects that align with the applications, environments, and clients that you host on DigitalOcean. To delete a project, the following criteria must be true: - The project must have no resources in it. To empty out the resources in a project, you can either destroy them or [move them into a new project](https://docs.digitalocean.com/products/projects/how-to/move-resources/index.html.md). - The project must not be the default project. You can set a different project as the default on the **Settings** tab of that project. ## Delete a Project Using the Control Panel To delete an empty, non-default project, visit the project’s **Settings** tab. ![Settings tab of a project](https://docs.digitalocean.com/screenshots/projects/settings.4ef56050a0e60cdf52975f4bd7ceb4b74dbb38a212253d4ac2f348089e2ed5a0.png) In the **Delete project** section, click **Delete Project**. When prompted, click **Confirm Delete**. This permanently removes the project from your account. ## Delete a Project Using Automation ## How to Delete a Project 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 projects delete`. Basic usage looks like this, but you can [read the usage docs](https://docs.digitalocean.com/reference/doctl/reference/projects/delete/index.html.md) for more details: ```shell doctl projects delete [ ...] [flags] ``` The following example deletes the project with the ID `f81d4fae-7dec-11d0-a765-00a0c91e6bf6`: ```shell doctl projects delete f81d4fae-7dec-11d0-a765-00a0c91e6bf6 ``` ## How to Delete a Project 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/projects/{project_id}`](https://docs.digitalocean.com/reference/api/reference/projects/index.html.md#projects_delete). ### cURL Using cURL: ```shell curl -X DELETE -H 'Content-Type: application/json' -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ "https://api.digitalocean.com/v2/projects/4e1bfbc3-dc3e-41f2-a18f-1b4d7ba71679" ``` ### 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() _, err := client.Projects.Delete(ctx, '4e1bfbc3-dc3e-41f2-a18f-1b4d7ba71679') } ``` ### Ruby Using [DropletKit](https://github.com/digitalocean/droplet_kit), the official DigitalOcean API client for Ruby: ```ruby require 'droplet_kit' token = ENV['DIGITALOCEAN_TOKEN'] client = DropletKit::Client.new(access_token: token) client.projects.delete(id: '4e1bfbc3-dc3e-41f2-a18f-1b4d7ba71679') ``` ### 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.projects.delete(project_id="fda9fda") ```