How to Destroy Namespaces

Functions are blocks of code that run on demand without the need to manage any infrastructure. Develop on your local machine, test your code from the command line (using doctl), then deploy to a production namespace or App Platform — no servers required. Learn more about functions.

Namespaces are a level of isolation and organization for functions and their settings. All functions and projects must be created in a namespace. Destroying a namespace permanently deletes all of its projects and functions.

Use the doctl serverless namespaces delete command to delete an existing namespace. You can specify the namespace to delete using either the namespace label or ID.

Delete by label:

doctl serverless namespaces delete sea-turtle-fn-namespace

Delete by ID:

doctl serverless namespaces delete fn-5073b12e-7c17-4446-a1dd-5b1c4c247e08

You are prompted to confirm the deletion. Type y then Enter to confirm:

Deleting namespace 'fn-5073b12e-7c17-4446-a1dd-5b1c4c247e08' with label 'sea-turtle-fn-namespace'.
Warning: Are you sure you want to delete this namespace? (y/N) ? y
Namespace successfully deleted

The namespace is deleted, along with all of the projects and functions that were in the namespace.

There are two places to destroy a namespace in the control panel. First, from the namespaces listing on the main Functions page you can click the “more” menu next to a namespace, then select Destroy Namespace:

a context menu showing an option to Destroy Namespace

Alternately, from inside the namespace you can click its Settings tab, then choose Destroy.

Either method will present you with a confirmation prompt. Enter the ID of the namespace then press Destroy to confirm.

The namespace is deleted, along with all of the projects and functions contained within.