Functions How-Tos

Generated on 17 Apr 2025

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.

Create

How to Create Functions

Create and deploy a function using the command line or control panel.

How to Develop Functions

Improve your serverless development with this guidance on invoking, iterating on, and observing DigitalOcean Functions.

How to Destroy Functions

You can destroy individual functions at any time. You can also destroy all functions in a namespace at once by resetting the namespace.

How to Include Static Files

Node.js, Python, and PHP functions include all the files in their directory when deployed. Functions written in Go must use the embed package to refer to these files.

How to Structure Projects

Projects contain functions that are grouped into packages and configured by a project.yml file.

Configure

How to Configure Functions

Configure the resource limits, runtime, and environment of your DigitalOcean Functions.

How to Schedule Functions

Schedule functions to run periodically.

How to Forward Logs

You can configure functions to forward console and error logs from the function to a third-party logging service. Functions supports Papertrail, Datadog, and Logtail.

Deploy and Use

How to Call Long-running Functions Asynchronously

You can invoke long-running functions asynchronously using the doctl command line tool or the Functions REST API. You cannot run functions invoked as web functions asynchronously.

How to Deploy Functions to App Platform

Use App Platform to deploy your Functions as a component of a production app.

Namespaces

How to Create Namespaces to Organize DigitalOcean Functions

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

How to Destroy Namespaces

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 destroys all of its projects and functions.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.